Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 是否可以在$window.open(url)方法中发送标题信息_Angularjs - Fatal编程技术网

Angularjs 是否可以在$window.open(url)方法中发送标题信息

Angularjs 是否可以在$window.open(url)方法中发送标题信息,angularjs,Angularjs,我正在使用API从服务器下载文件,因为我必须在标题中发送会话详细信息,我如何使用angularjs?。请帮帮我 提前感谢您的建议。我不建议使用window.open传递参数 但你们可以用窗户,像这样打开 var params = { access_token: 'An access_token', other_header: 'other_header' }; //Add authentication headers in URL var url = [url_generating_pdf

我正在使用API从服务器下载文件,因为我必须在标题中发送会话详细信息,我如何使用angularjs?。请帮帮我


提前感谢您的建议。

我不建议使用window.open传递参数

但你们可以用窗户,像这样打开

var params = {
 access_token: 'An access_token',
 other_header: 'other_header'
};

//Add authentication headers in URL
var url = [url_generating_pdf, $.param(params)].join('?');

//Open window
window.open(url);

请检查详细信息

我不建议使用window.open传递参数

但你们可以用窗户,像这样打开

var params = {
 access_token: 'An access_token',
 other_header: 'other_header'
};

//Add authentication headers in URL
var url = [url_generating_pdf, $.param(params)].join('?');

//Open window
window.open(url);

请检查详细信息

-无法使用
$window直接发送标题。请打开


-这是可能的,但不是直接的,如果您有服务器端控制,那么您可以在查询字符串中设置
值,并从后端的查询字符串中解析它。

-不可能使用
$窗口直接发送头。打开


-这是可能的,但不是直截了当的,如果您有服务器端控制,那么您可以在查询字符串中设置
值,并从后端的查询字符串中解析它。

不,对我不起作用。这只是将标题中需要的值附加到URL字符串中。这不是同一件事。不要把令牌放在URL中-这是不安全的不,对我来说不起作用。这只是将标题中需要的值附加到URL字符串中。这不是一回事。不要把令牌放在URL中——这是不安全的