IE8 displays a white page when adding Javascript

I recently created a website and added some jQuery to it. However, IE8 displays a white page. Whenever I remove Javascript, IE8 makes the site beautiful. I tested both locally and on the Internet, the problem still persists.

This is my code for including my .js files:

<script type="text/javascript" src="jQuery/jQuery.js" />
<script type="text/javascript" src="jQuery/effects.js" />
+3
source share
3 answers

Try closing the script tags with the HTML method:

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

The reason for this is probably because IE cannot parse XHTML, instead it tries to convert XHTML to plain HTML and chokes the script tags, which uses final-slash to close.

+9
source

script HTML Internet Explorer. , -, .

<script>.

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

+1

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

+1
source

Source: https://habr.com/ru/post/1737432/


All Articles