jquery returns a JSON array under Firefox normal to Chrome will lose 2 key values corresponding to the value of ... Why...
{"Errcode": 1, "data": {"name": {"103_0": "11111", "id": "103", "vkey": "103_0"}, "key": {"11111": "103_0"}, "file": {"": null}, "url": {"": null}}}----"The JSON that is taken in chrome
JSON that is taken from Firefox
{"Errcode": 1, "data": {"name": {"104_293": "\u5b66\u4e60\u5b66\u4e60\u5b66\u4e60\u4e0b", "id": "104", "Vkey": "104_293 "}," key ": {" \u5b66\u4e60\u5b66\u4e60\u5b66\u4e60\u4e0b ":" 104_293 "}," file ": {" 293 ":" Award-46696.jpg "}," url ": {" 293 ":" Http:\/\/hr.ryanren.dev.aifang.com\/upload\/train\/award\/award-46696.jpg "}}}
Jquery:
function Add_award (award_name,file_id) {
Jquery.ajax ({
Url:award,
Data: {
' Name ': Award_name,
' Type ': ' Add ',
' file_id ': file_id,
' prof_id ': pro_id,
},
Type: ' Post ',
Async:false,
DataType: ' JSON ',
Success:function (MyData) {
Console.log (MyData);
var str = '' +award_name+ '' +mydata.data.file[file_id]+ '
";
$ ("#info_award"). Append (str);
$ ("#pro_award"). Val (');
$ ("#upload_icon"). Val (');
},
Error:function () {
Alert ("Error, please refresh the page, re-operate!");
}
});
}
share to: !--Baidu button BEGIN--> more !--Baidu Button END-->
---- --The solution--------------------
There is no similarities between the two JSON you gave. How can the
know what's missing?