Sunday 5 September 2010

Debugging JavaScript in Internet Explorer (IE)

Recently, I was required to debug JavaScript in Internet Explorer (IE). JavaScript debugging is disabled by default. Most of companies disable editing advanced options of IE. So one need to edit registry settings in order to enable JavaScript debugging. Remember, you need permission to modify registry settings. If you are not sure of changes, it is a good idea to take back up of registry by using File -> Export option from Registry Editor.

The steps to enable JavaScript debugging in IE, follow the steps as mentioned below:
  1. Close all Internet Explorer windows.
  2. Open Registry Editor (Start -> Run -> regedit)
  3. Search for Disable Script Debugger key (Ctrl + F)
  4. The key will be present under [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main] 
  5. Edit key "Disable Script Debugger"
  6. Set value to "no"
  7. Start Internet Explorer
And you are all set to debug JavaScript in IE. You may find Microsoft Script Editor as good option to debug JavaScript, if you do not have Visual Studio installed. Generally, path of Microsoft Script Editor on Windows is "C:\Program Files\Microsoft Office\Office10\MSE7.EXE"