DelphiFAQ Home Search:

HTML Content invisible in IE, but properly shown in Firefox

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Recently I added some javascript to this web site and tested it in FireFox. Everything worked fine. Then I got emails that the comments were no longer visible. I tested, and could not confirm the problem. Today at a friend's house, I encountered the same problem. Comments were invisible on all pages if you used Internet Explorer. They would show fine in Firefox!

Here are some thoughts I had:

  • invalid Google Adsense code
  • run the HTML validator (it validated my page as 100% conform)
  • compare the HTML presented to IE with the HTML presented to FireFox (it was identical)

Eventually I found the reason for the problem.
See the code segment below. It causes text XXX to be rendered in FireFox but IE would not show it (it would treat it as a comment!)

The W3 HTML validator would not catch this as a bug!

Look at the bolded section - you can see that I forgot the matching closing part. FireFox would ignore this problem and recognize the end of the javascript by the /script tag. IE would ignore everything up to the //--> tag.

<script language=javascript>
<!--
alert('blah');
</script>

XXX

<script>
alert('blah2');
//-->
</script>

yyy

Comments:

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: