开发者

Question about JSON

开发者 https://www.devze.com 2023-01-07 04:30 出处:网络
If I console.log(result); 开发者_Python百科I get {\"MSG\":\"WRONG\",\"QUESTIONID\":182.0} But If I console.log(result.QUESTIONID); I get

If I console.log(result); 开发者_Python百科I get

{"MSG":"WRONG","QUESTIONID":182.0}

But If I console.log(result.QUESTIONID); I get

undefined

What am I doing wrong?


I needed to do this:

$.ajaxSetup({
    type: "POST"
    ,dataType: 'json'
    ,error: function(XMLHttpRequest, textStatus, errorThrown) {
        $('#msg').text(textStatus).addClass('err');
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消