Javascript debugger in Firefox: how to display call stack with error

I am making a web application. In Firefox, I can use the web developer debugging tool.

In my Javascript code, I got an error in Firefox

TypeError: a is undefined 

The above error occurred in jQuery.

I know that the data I pass to jQuery is incorrect. However, there are many jQuery calls in my code, and I donโ€™t know which call will lead to this error.

In any case, to show a stack of calls that lead to an error via Debugger? How does Java show error stack trace?

Thanks!

+5
source share
1 answer

Here is what I did.

Use the jQuery version for development (not the file with min in it).

Find the error line in jQuery. Before this, insert the following:

 console.trace(); 

console.trace () shows the trace.

I am not sure if there is an easier way.

Hope this helps someone else.

Greetings.

+1
source

Source: https://habr.com/ru/post/1206770/


All Articles