Error handling in getJSON calls

后端 未结 9 1631
野的像风
野的像风 2020-11-28 02:09

How can you handle errors in a getJSON call? Im trying to reference a cross-domain script service using jsonp, how do you register an error method?

9条回答
  •  自闭症患者
    2020-11-28 02:21

    Someone give Luciano these points :) I just tested his answer -had a similar question- and worked perfectly...

    I even add my 50 cents:

    .error(function(jqXHR, textStatus, errorThrown) {
            console.log("error " + textStatus);
            console.log("incoming Text " + jqXHR.responseText);
        })
    

提交回复
热议问题