$.getJSON(json_url,function(data) { // application logic }).error(function() { console.log("error"); });
问题是,当服务器返回404错误时,它似乎没有被处理,因为没有console.log()说错误,但有一个GET请求失败,代码为404(未找到)显示在控制台.
我正在使用jQuery 1.9.0.
我正在制作一些简单的错误吗?
从docs:
When data is retrieved from remote servers (which is only possible using the script or jsonp data types),the error callbacks and global events will never be fired.
script
jsonp