Internet Explorer has three settings that deal with script debugging. They are located under Tools -> Internet Options – > Advanced
Only two out of these three settings are relevant:
- Disable script debugging (Internet Explorer)
- Display a notification about every script error
Here is an example of a simple html webpage:
When this page is loaded, IE does not report any errors since the page is syntactically correct.
Let’s introduce a script error on line 5 by not closing the bracket:
Before we refresh the page in IE, let’s check “Disable script debugging (Internet Explorer)”.
If we refresh the page now, the page would load as it did in the previous case without any errors reported.
Lets now also check “Display a notification about every script error” to display the script error
When we refresh the page a pop-up dialog with the error line number and description will be displayed.
If we decide to uncheck “Disable script debugging (Internet Explorer)” irrespective of the “Display a notification about every script error” setting, a pop-up dialog will be displayed asking whether we want to debug the error.
Clicking “Yes” invokes VS Just-In-Time debugger and allows us to either open a new instance of VS or choose an existing one to debug the error.
Invoking the VS instance sets the cursor at the line that raised an exception.
Refreshing the page invokes the JIT. After we select VS instance the debugger is invoked and from that point on we can debug the code as we would any other compiled code such as C#.
The default IE setting disables script debugging and displaying script errors. Too many pages on the internet contain script errors so it makes sense to keep the settings as they are, unless you plan to do debugging.