Tag internet explorer

How to get Internet Explorer javascript debugging really set up using Visual Web Developer 2008 Express (free version)


I don't know why all the existing articles out there in Internet Explorer javascript debugging always tell you to try the Microsoft Script Editor or other such steaming piles of feces from 2002. Microsoft's Visual Web Developer 2008 at least was released in the last year of the Bush presidency, instead of the beginning of the first term. They GET you by disabling the ability to attach to existing processes, but turns out you don't need to attach... you can just create an attached browser directly out of the free version.

Epic win.

First, download the free version of Visual Web Developer 2008 here. Install it. Enjoy waiting twenty minutes. Get a cup of coffee. Don't sit there waiting for the worst out of box experience ever, whatever you do.

Next, go to Internet Explorer's Internet Options and set Internet Explorer as your default browser. I know, terrible, but you gotta do it -- otherwise VWD2008 tries to use Firefox, Chrome or your other superior default browser and you lose the ability to debug IE7 in all of its awful putrescence.

While you're in Internet Options, you should also de-select disabling script debugging and enable debug messages in the Advanced tab.

Now you have to create an Empty Web Project by clicking New > New Website. Now click Debug > Start Debugging. It'll open a new IE window pointed at localhost, but just fire up whatever to-be-debugged website in that window. 

Awesome. Now any errors should drop you into the VWD2008 debugger. ROCK ON.

Running IE6, IE7 and IE8 on your Mac

I use a Mac, which means testing my work in IE6, IE7 and IE8 is a pain. I have Parallels installed but I don’t want to buy extra copies of Windows just to test in IE. Plus, Parallels doesn’t compress the virtual hard drive so each OS takes about 10 - 20GB of space.

The good news is that Microsoft provides free VirtualPC disk images for each of their browsers.

The bad news is that they wont run on Mac and VirtualPC wont run inside Parallels or VMWare Fusion — but I’ve found a solution! We can convert the disk images to work for VMWare Fusion or VirtualBox.

I'm giving this a shot... *crosses fingers* -- will update when it's good to go.

Javascript super killer tip: Always use innerHTML if you have no JS lib and it has to work in IE.

Recently while writing some features for Posterous, I ran into a super simple but insanely annoying bug where IE fails to properly pick up id and name fields when creating new DOM elements in JavaScript using document.createElement().

Internet Explorer completely fails to add created DOM elements to the lookup table of named elements as targets. If you generate an iframe and want to POST to it from your programmatically generated FORM tag (by setting TARGET="your_new_element_name"), you're out of luck and IE will try to create a new window instead.

InnerHTML to the rescue. The abomination of standards that is innerHTML works pretty well across all browsers. John Resig is so right when he says the DOM is a mess. Thank god for things like jquery.