首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何追踪firebug错误的来源?

如何追踪firebug错误的来源?
EN

Stack Overflow用户
提问于 2012-06-20 17:02:13
回答 1查看 36关注 0票数 0

例如,我的控制台显示以下错误

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

我如何才能将范围缩小到特定的代码行呢?

EN

回答 1

Stack Overflow用户

发布于 2012-06-20 17:31:52

如果您使用XHR,请使用处理程序。

代码语言:javascript
复制
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内的处理程序中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11116126

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档