IE <javascript> tag problem

Today one of my colleague Muhammad Fareed Uddin sent an email in which he described the problem related to <javascript> tag. I don't want to take credit from him so below is email I received from him:

I’ve found a bizarre behavior of html script tag (that is used to include javascript files), which I would like to share with you guys.

Sometimes, closing the tag like this <script type="text/javascript" src="User.aspx.js"/> (with “/>”) can cause some rendering problems. By that I mean, some controls may not be properly displayed or not displayed at all. (I recently faced this issue). To remedy the situation, I closed it like this : <script type="text/javascript" src="User.aspx.js"></script>, and it worked! Interestingly, IDE won’t warn you over this.

So if you’re caught into some weird rendering problem, may be it is because of the above stated reason.

Something I found that it is not bug in IE instead in an ambiguity in DTD, but question is that why only with IE?

For further information you can use following links:

Technorati Tags: ,


Anonymous said…
Due to this bug in IE, always, always close your script tags with a separate closing tag.

See bug report here:
Bug 153


Popular posts from this blog


Khuda Karay K Meri Arz -e- Pak Par Utray

کولہوں کے بیل