Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebug - Breakpoint doesn't hit

I am setting breakpoints in an external JS file and I haven't been able to get Firebug hit the breakpoint in a consistent way. It works sometimes but most of the times it doesn't. The only way I can get it to work is by switching on "Break on all errors"

I have used the debugger; statement as well without any luck.

like image 462
DotnetDude Avatar asked Mar 16 '09 17:03

DotnetDude


2 Answers

If the line numbers aren't green, it seems like Firebug cannot debug that part of code because it is out of scope. So, if you're using something like $(function () { ... }); Firebug will not be able to access Functions and variables.

Does that make sense?

Also, is it possible that some other function or something is overriding the one you're trying to debug. It's even possible if you're including the same JS file twice.

Hope that helps.

like image 190
Eric Wendelin Avatar answered Oct 01 '22 14:10

Eric Wendelin


Does Firebug show the code in the Script tab with green line numbers? This indicates debuggable lines of code.

I've experienced this symptom where none of the line numbers were green at times. I refresh the page and magically, they're green again.

like image 33
spoulson Avatar answered Oct 01 '22 14:10

spoulson