Jump to main navigation, main content

Archived entry | Matt Wilcox .net

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.


skip to comment form
  1. Troy Dalmasso posted 32 days, 14hrs, 15mins after the entry and said:

    I had the same problem and couldn't figure out what was going on. You saved me some grief.


  2. Julie Cameron posted 48 days, 11hrs, 38mins after the entry and said:

    Thank you SO much.

  3. Tom Nicholls posted 62 days, 22hrs, 19mins after the entry and said:

    Marvellous - I could have been there for WEEKS trying to solve this. Thanks…

  4. René A. Enguehard posted 64 days, 16hrs, 25mins after the entry and said:

    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.

From the archives

Other enteries filed under:

Web Development

Site information

Built with valid XHTML and CSS, designed with web standards and accessibility in mind. Best viewed in a modern browser [Firefox, Safari, Opera]

This domain and all content is a copy of my old website, for historical purposes only.