Home  >  Article  >  Backend Development  >  jquery回到json数组在firefox下正常 可到了chrome下会丢失2个键值对应的值。为什么。

jquery回到json数组在firefox下正常 可到了chrome下会丢失2个键值对应的值。为什么。

WBOY
WBOYOriginal
2016-06-13 11:43:04993browse

jquery返回json数组在firefox下正常 可到了chrome下会丢失2个键值对应的值。。。为什么。。。
{"errcode":1,"data":{"name":{"103_0":"11111","id":"103","vkey":"103_0"},"key":{"11111":"103_0"},"file":{"":null},"url":{"":null}}} ----》chrome中取到的json

firefox下取到的json
{"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("出错了,请您刷新页面,重新操作!");
     }
     });
    }
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn