What's Actually In This Page?
So how does one keep track of all this stuff? How does one even begin to put it all together?
- Open up Internet Explorer. Click Tools->Options.
- Click on the the Advanced Tab.
- Under the Browsing category, ensure that the "Disable script debugging (Internet Explorer)" is unchecked (below).
Two Ways to Attach
Consider the following html page:
Some random html
var foo = "some string";
Notice the use of the debugger keyword? This is a special command which causes a runtime exception and allows Visual Studio to attach and debug. This is often useful if you want to attach and debug before the page is finished loading in the browser. As an example you could take the above html, and use it to make a test.html page. When you open it in Internet Explorer you will have the option of attaching to it.
To use either option you need to enable script debugging in IE (see above steps 1 to 3).
To pull up the Script Explorer you can either press CTRL+ALT+N while debugging OR you can add it to a toolbar by doing the following:
- In Visual Studio click Tools->Customize
- Under the Commands tab click the Debug category.
- Find Script Explorer and drag it into a toolbar or menu (like Debug).