Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make firefox report the javascript error?

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>
like image 740
Bin Chen Avatar asked Jan 17 '11 04:01

Bin Chen


People also ask

How do I see JavaScript errors in Firefox?

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.

How do I enable reporting of JavaScript errors?

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:...

How to report JavaScript errors and warnings in Firefox?

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:

How do I display the errors found in Firefox?

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:

What is the Error Console in Mozilla Firefox?

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.


2 Answers

To configure Firebug to show errors, do the following:

  • Click the arrow on the Console tab.
  • Make sure it's Enabled.
  • Make sure "Show JavaScript Errors" is checked.

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.

like image 55
jmort253 Avatar answered Nov 15 '22 15:11

jmort253


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.

like image 38
xiaowl Avatar answered Nov 15 '22 16:11

xiaowl