How to Debug JavaScript with Ie 8

How to debug Javascript with IE 8

I discovered today that we can now debug Javascript With the developer tool bar plugins integreted in IE 8.

  • Click ▼ Tools on the toolbar, to the right of the tabs.
  • Select Developer Tools. The Developer Tools dialogue should open.
  • Click the Script tab in the dialogue.
  • Click the Start Debugging button.

You can use watch, breakpoint, see the call stack etc, similarly to debuggers in professional browsers.

You can also use the statement debugger; in your JavaScript code the set a breakpoint.

how to debug javascript errors on IE8

Make sure script debugging is not disabled for IE, otherwise it should allow you to debug the script directly:

Sample Image

Sample Image

Debugging JavaScript in IE

Several options:

  • Open the IE developer tools (by hitting F12 while in the browser), and use the provided JavaScript debugger. To get to know it better, see the MSDN reference on using the JavaScript debugger (and a newer reference).
  • Install Debug Bar, which provides an extended feature-set to the built-in developer tools.
  • Install IE Tester, which emulates various IE instances (versions), and use its built-in Debug Bar. With that approach, you can also pin-point version-specific problems.

How to debug a stack overflow error in IE8

You can debug script in IE using IE developer tools. Just press F12 to activate developer tools. IE also comes with an in built developer tool like Google chrome(not not that user friendly). But you can still use it to debug script and to watch call stack. use debugger; like we use in other debuggers.

You can get better control in script debugging using visual studio. If you a .Net developer you can use VS itself to debug JavaScript.

Find more here

How do I dump JavaScript vars in IE8?

Here's one technique that I've found helpful:

  • Open the Developer Tool Bar (hit F12)
  • Go to the "Script" tab
  • Click the "Start Debugging" button
  • Next, type "debugger" into the console and hit enter. This should trigger a break point.
  • Go to the "Watch" sub-tab
  • Click the row that says, "Click to add..." and enter a variable you'd like to examine. Note that the variable must be globally available.
  • At this point you should be able to examine your variable with tree-like UI
  • Once you're done debugging click Continue button (or hit F5)

Using the IE8 'Developer Tools' to debug earlier IE versions

There are differences between native IE6/7 and the IE8 compatibility mode:
http://blogs.msdn.com/ie/archive/2009/03/12/site-compatibility-and-ie8.aspx

The best option I've found to debug in IE6/7 is to install the Microsoft Script Editor (not Debugger), that is bundled with Microsoft Office. It's an optional install, so you probably have to open Add remove programs in Control panel and go through setup again. Here's a guide to configure IE after you've installed the Microsoft Script Editor.
http://www.jonathanboutelle.com/mt/archives/2006/01/howto_debug_jav.html

The default view doesn't have breakpoints and such, so take a look at the menu to add the views you like. It's not as good as Firebug, but it's a lot better than alert-debugging ;)



Related Topics



Leave a reply



Submit