Content dissapears in IE8 (shows in Firefox)

Posted on September 11th, 2009

Had this rather annoying and seemingly tricky to find bug, but luckily there’s a pretty straight forward resolution to it.

Problem

Whilst developing a website happily in my browser of choice Firefox (3.52), I fired up IE8 to check the layout when to my shock – I found nearly all the site content was gone!

Viewing source the code was all still there?

Disabling all CSS – gave the same lack of content (minus styles).

Solution

When examining the code I noticed that in the header I had some  inline javascript, one of the comments in this block had a comment using standard html

<script type="text/javascript">
<!-- comment -->
...javascript code here...
</script>

tags.  I changed this to the correct javascript

// comment

or

/* comment */

would work fine too.

Refreshed the page in IE8 and all was right with the world again.

Add a Comment

You must be logged in to post a comment.