views:

237

answers:

3

I recently created a website and added some jQuery into it. However doing this makes IE8 display a white page. Whenever I remove the Javascript IE8 renders the site fine. I have tested locally as well as on the internet, the problem still persists.

This is my code to include my .js files:

<script type="text/javascript" src="jQuery/jQuery.js" />
<script type="text/javascript" src="jQuery/effects.js" />
+7  A: 

Try closing the script tags the HTML way:

<script type="text/javascript" src="jQuery/jQuery.js"></script>
<script type="text/javascript" src="jQuery/effects.js"></script>

The reason for this is probably that IE can't parse XHTML, instead it tries to convert XHTML to regular HTML and chokes on script tags that uses ending-slash for closing.

David
thanks for reminding :)
portland
+1  A: 

Self-closing script tags are not interpreted in HTML by any version of Internet Explorer. It seems to be a very strict interpretation of rules.

You will need to close the <script> tags explicitly.

<script type="text/javascript" src="jQuery/jQuery.js" ></script>
<script type="text/javascript" src="jQuery/effects.js"></script>

See this question

Pekka
It's a perfect interpretation of rules. The rules need a closing tag and there's no such thing as a self-closing (only an auto-closing) tag in HTML.
Eli Grey
+1  A: 

Self-closing tags are part of XHTML, not HTML. No versions of IE before IE9 support XHTML so I'll assume that you're serving HTML. Close script tags in HTML with </script>.

Eli Grey