繁体   English   中英

获取json数组并将数据附加到另一页中

[英]fetch json array and append data in another page

我正在尝试使用jQuery将json数组传递到另一个页面,并且在另一个页面上我想将数据绑定到相应的元素。这是我的ajax请求:

$.ajax({
    type: "GET",
    url: 'url of the php page',
    data: {'json':jsondata},
    dataType :'json',
    async: false,
    encode: true
}).done(function(data) {
    window.location.href = 'anotherpageurl?res='+encodeURIComponent(JSON.stringify(data));
});

这是我收到的url的json响应:

{
"data": [
{
"full_name": "xxxx",
"employee_id": "xxxxx",
"imageUrl": "xxxx",
"dname": "xxxx"
},
{
"full_name": "xxxxx",
"employee_id": "xxxxx",
"imageUrl": "xxxx",
"dname": "xxxx"
}
]
}

使用数据而不是数据(数据)

以下信息可能会帮助您参考以下URL编码,

https://zh.wikipedia.org/wiki/百分比编码

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM