0

たとえば、コンソールに次のエラーが表示されます

https://dl.dropbox.com/u/12337149/firebug.png

これを特定のコード行に絞り込むにはどうすればよいですか?

4

1 に答える 1

1

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 にブレークポイントを設定します。

于 2012-06-20T09:31:51.533 に答える