【问题标题】:XMLHttpRequest Exception 101 error with ajaxajax 的 XMLHttpRequest 异常 101 错误
【发布时间】:2012-12-11 02:42:19
【问题描述】:

我在 Jquery 移动网站中使用此代码。 但是,它给我一个错误

 {readyState: 0, status: 0, statusText: "Error: NETWORK_ERR: XMLHttpRequest Exception 101"}

我卡在这里,无法找出问题所在! 我没有找到一个好的答案。

$(function () {
    calldata();
});

function calldata() {
var url = "http://www.mywebsite.com/json.php" ;

var json = (function () {
    var json = null;
    $.ajax({
        'async': false,
        'global': false,
        'url': url,
        'error': function (data) { console.log(data); },
        'success': function (data) {
            json = data;
            console.log(data);
        }
    });
    return json;
})(); 

}

【问题讨论】:

    标签: jquery jquery-mobile console


    【解决方案1】:

    解决了=P

        $.ajax({
            'async': false,
            'global': false,
            'dataType': 'JSON', // this line was missing
            'url': url,
            'error': function (data) { console.log(data); },
            'success': function (data) {
                json = data;
                console.log(json);
            }
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-17
      • 2012-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多