Getting a blank page in Internet Explorer, but not in other browsers?
A problem that we recently ran into at work was an XHTML page displaying perfectly in Firefox, Opera, Safari et al - but showing a completely blank white page in IE6 and IE7. I had vague recollections of having this issue before, and fixing it, but I’d forgotten what the deal was. We narrowed it down to the JavaScript (commenting it out fixed the issue), then managed to pinpoint the cause: we were using a self-closing tag, but IE doesn’t support a self-closing JavaScript tag! We were using:
<script type="text/javascript" src="path/to/script" />
Which is perfectly valid code, but makes IE fall over completely. Instead we needed to use long-hand:
<script type="text/javascript" src="path/to/script" ></script>
And voilat - the page returns in Internet Explorer. I just thought I should blog the issue so I don’t forget it again, and hopefully help out anyone else who’s wondering why IE has eaten their web page.
Entry Information
- Posted:
- Thu, 15th Feb 2007 at 09:02 UTC
- Filed under:
- Tags:
Comments
skip to comment formI had the same problem and couldn't figure out what was going on. You saved me some grief.
Thanks!
Thank you SO much.
Marvellous - I could have been there for WEEKS trying to solve this. Thanks…
Thanks for the tip. IE seems to do things backwards a lot of the time and I assumed it was something within my script that was causing the issue. This was reinforced by the fact that removing the script made the page work again. Ugh, so frustrating. That's 4 hours of my life wasted.