Wednesday, July 11, 2007

Firefox comments issue

Here's an issue to be aware of in Firefox browsers:

If you make a comment in a .jsp file like this:
<!-- This is my comment -- no real info though -->

It will work fine in IE, but in Firefox I have found this to cause major problems, as it will interpret this as an unterminated comment:
<!-- This is my comment

So, be careful not to include -- in your Firefox comments!

Also, don't use the single tag element terminating slash for script includes:
<script type="text/javascript" src="test.js"></script> (This will break in IE7 or Firefox)
<script type="text/javascript" src="test.js"/> (This will work)

No comments: