如何将JSON回调proj
附加为查询字符串?
success: function(response){
window.proj = '?proj='+response.proj;
alert(proj);
}
需要在export.php?proj=project-name
<button type="button" onClick="parent.location='export.php'">Submit</button>
有可能吗?
答案 0 :(得分:0)
decodeURIComponent函数在给定的字符串中搜索转义序列,并用实际字符替换它们。
success: function(response){
window.proj = '?proj='+response.proj;
//If data is your object with key value pair of names and values
var data = { first_parameter: 'first', second_parameter: 'second' };
var queryStringparams = decodeURIComponent($.param(data));
//End
alert(proj);
}