发布于 2012-06-20 17:31:52
如果您使用XHR,请使用处理程序。
var xhr = new XMLHttpRequest();
xhr.open('GET', "http://www.some.com", true);
xhr.onreadystatechange = handler;
xhr.send();
function handler(){
if (this.readyState == this.DONE)
{
if (this.status == 200 && this.responseXML != null )
{
var response = xhr.responseXML;
}
else{
console.log("status:" + xhr.status);
alert("xhr Errors Occured");
}
}
else
console.log("currently the application is at " + this.readyState);
}并将断点放在Firebug内的处理程序中。
https://stackoverflow.com/questions/11116126
复制相似问题