Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Javascript error?

How to Debug java Script Error Using Firebug?

Duplicate

How can I set breakpoints in an external JS script in Firebug

like image 540
Wasim Shaikh Avatar asked May 04 '09 08:05

Wasim Shaikh


People also ask

How do I debug JavaScript errors in Chrome?

In Chrome, navigate to Tools > Advanced > Error Console. The error console will open. Select JavaScript and Errors from the two drop downs. To find the error location, expand one of the errors.

Can we debug JavaScript?

But fortunately, all modern browsers have a built-in JavaScript debugger. Built-in debuggers can be turned on and off, forcing errors to be reported to the user. With a debugger, you can also set breakpoints (places where code execution can be stopped), and examine variables while the code is executing.


1 Answers

Debug using FireBug.

Just check the line on which the error is occuring, then, just before that line, write a "debugger" call.

debugger; //Will invoke FireBug's debugger.
var err = abcs; //Line containing error
like image 84
Kirtan Avatar answered Sep 28 '22 08:09

Kirtan