如何在文件中找到真正的错误?

时间:2022-06-21 04:47:05

I wrote a program and want to debug it using firebug. But firebug always tells me there is something wrong with my library files such as jquery, which is absolutely not the root of the problem. It shows as follows:

我写了一个程序,想用firebug调试它。但是firebug总是告诉我我的库文件有问题,例如jquery,这绝对不是问题的根源。它显示如下:

((f.event.special[s.origType] || {}).handle || s.handler).apply is not a function

...{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAt...     jquery....min.js (line 3)

I know there must be something wrong with my program. But how could I find the real bug in my files?

我知道我的程序一定有问题。但是我如何在文件中找到真正的错误?

2 个解决方案

#1


2  

Place a breakpoint on the jQuery line where the error occurs and unwind the call stack until it originates with your code (which will probably call a jQuery method with incorrect argument types, etc).

在发生错误的jQuery行上放置一个断点并解开调用堆栈,直到它与您的代码一起发生(这可能会调用带有不正确参数类型的jQuery方法等)。

#2


0  

如何在文件中找到真正的错误?

From @alex answer, here is how to use breakpoint.

从@alex回答,这里是如何使用断点。

Click at line number that you want. Just keep an eye on the line and press F10 to the next line. At line 10 will throw to library. Because an error. Hope it can help you.

单击所需的行号。只要注意线路,然后按F10到下一行。第10行将投掷到图书馆。因为错误。希望它可以帮到你。

#1


2  

Place a breakpoint on the jQuery line where the error occurs and unwind the call stack until it originates with your code (which will probably call a jQuery method with incorrect argument types, etc).

在发生错误的jQuery行上放置一个断点并解开调用堆栈,直到它与您的代码一起发生(这可能会调用带有不正确参数类型的jQuery方法等)。

#2


0  

如何在文件中找到真正的错误?

From @alex answer, here is how to use breakpoint.

从@alex回答,这里是如何使用断点。

Click at line number that you want. Just keep an eye on the line and press F10 to the next line. At line 10 will throw to library. Because an error. Hope it can help you.

单击所需的行号。只要注意线路,然后按F10到下一行。第10行将投掷到图书馆。因为错误。希望它可以帮到你。