At which point I got redirected to a "The page cannot be displayed" IE error.
I trimmed everything out of the webpage which had nothing to do with the error and I was left with a tiny page which still produced the error:
Workarounds and Solutions:
- using <body onload='creatediv()' > instead of calling it within the page
- if using an event handler class like in http://www.dustindiaz.com/rock-solid-addevent/
Code that doesn't produce the error: