关于JSON的问题

时间:2010-07-11 03:09:27

标签: jquery ajax json

如果我是console.log(结果);我得到了

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

但是如果我是console.log(result.QUESTIONID);我得到了

undefined

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我需要这样做:

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