I am developing with Firefox and Firebug, but in my environment if the js has the syntax error, the firefox will not report any error, it just stops there.
Then I have to use IE to reload the page, IE will report the error at the bottom left corner, and after clicking it I can see the line number of the js error.
I am wondering if I misconfigured something? I think at least firebug should report the error as IE does. But firebug displayed nothing.
The example code(show error in IE but normal in FF):
<!DOCTYPE html>
<html>
<head>
<style>
body { color:blue; }
</style>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
</head>
<body>
<script>
if (a < ) 0 {
}
</script>
</body>
</html>
In Firefox, navigate to Tools > Web Developer > Error Console or press Ctrl + Shift + J. The error console will open. If you don't see any errors try reloading the page. The error may be generated when the page loads.
Firefox - enable reporting of Javascript errors. Firefox uses the error console to present the errors found on a web page. To see it, press ctrl + shift + j. Other browsers like Microsoft Internet Explorer have opted to alert the errors found by default, that is why you see them on an popup. As can be read on the MDN Error Console page:...
It reports JavaScript-related errors and warnings, CSS errors and arbitrary messages from chrome code. In Firefox, the Error Console can be opened from the tools menu or by Ctrl-Shift-J. For an immediately presentation of errors on Firefox, for anyone willing to use add-ons:
Firefox uses the error console to present the errors found on a web page. To see it, press ctrl + shift + j. Other browsers like Microsoft Internet Explorer have opted to alert the errors found by default, that is why you see them on an popup. As can be read on the MDN Error Console page:
The Error Console is a tool available in most Mozilla-based applications that is used for reporting errors in the application chrome and in web pages user opens. It reports JavaScript-related errors and warnings, CSS errors and arbitrary messages from chrome code. In Firefox, the Error Console can be opened from the tools menu or by Ctrl-Shift-J.
To configure Firebug to show errors, do the following:
You should see the errors in the console now, and it should show you the line number and filename.
I am using Firefox 3.6 and Firebug 1.5.0.
UPDATE: This same process also works in the latest Firefox Nightly 19.0a1, using Firebug 1.10.4. Thus, these instructions are still up to date.
I think you may enable the 'Script' option. With this option on, while a js error occurs, firefox stops caused by the breakpoint of js source where error occurs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With