最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - Internet Explorer (IE) does not request external JavaScript and CSS - Stack Overflow

programmeradmin1浏览0评论

I have included a couple of external JavaScript files in a webpage. These JavaScript works well on all browsers, except IE. On IE, these two files are not included in the webpage. Even on the "Network" section of F12 Developer Tools, it does now display requests to the two external javascript files. Also, I have included two external CSS file on the page. These CSS files also does not get any request too.

What could be the problem?

The page: .html The external JavaScript files:

<script type="text/javascript" src=".colorbox-min.js"></script>
<script type="text/javascript" src=".js"></script>

The external CSS files:

<link href=".css" rel="stylesheet" />
<link href=".css" rel="stylesheet" />

I have included a couple of external JavaScript files in a webpage. These JavaScript works well on all browsers, except IE. On IE, these two files are not included in the webpage. Even on the "Network" section of F12 Developer Tools, it does now display requests to the two external javascript files. Also, I have included two external CSS file on the page. These CSS files also does not get any request too.

What could be the problem?

The page: http://shapco.plus.printsites./templates-download.html The external JavaScript files:

<script type="text/javascript" src="http://templates.kliqprint.us/js/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="http://templates.kliqprint.us/js/templates.js"></script>

The external CSS files:

<link href="http://templates.kliqprint.us/css/colorbox.css" rel="stylesheet" />
<link href="http://templates.kliqprint.us/css/style.css" rel="stylesheet" />
Share Improve this question edited Oct 23, 2012 at 15:42 Debiprasad asked Oct 23, 2012 at 15:35 DebiprasadDebiprasad 6,22318 gold badges70 silver badges96 bronze badges 2
  • The link to the page isn't working. Could you get that back up and/or post the entirety of the html(or at least the markup surrounding those tags) – Ryan O'Neill Commented Oct 23, 2012 at 16:04
  • Here is the full HTML code: jsfiddle/Debiprasad/uAytQ – Debiprasad Commented Oct 23, 2012 at 16:08
Add a ment  | 

5 Answers 5

Reset to default 3

Your doctype is xhtml strict , which does not allow css declaration outside head tag.

Maybe you should first work on making your document xhtml-strict valid

    Result: 18 erreurs / 0 avertissements

    line 73 column 79 - Erreur: there is no attribute "onKeyPress"
    line 79 column 29 - Erreur: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
    line 80 column 7 - Erreur: document type does not allow element "tr" here
    line 81 column 20 - Erreur: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
    line 83 column 7 - Erreur: end tag for "tr" omitted, but OMITTAG NO was specified
    line 78 column 4 - Info: start tag was here
    line 111 column 216 - Erreur: required attribute "alt" not specified
    line 113 column 9 - Erreur: ID "_mcePaste" already defined
    line 112 column 9 - Info: ID "_mcePaste" first defined here
    line 114 column 9 - Erreur: ID "_mcePaste" already defined
    line 112 column 9 - Info: ID "_mcePaste" first defined here
    line 115 column 9 - Erreur: ID "_mcePaste" already defined
    line 112 column 9 - Info: ID "_mcePaste" first defined here
    line 116 column 9 - Erreur: ID "_mcePaste" already defined
    line 112 column 9 - Info: ID "_mcePaste" first defined here
    line 450 column 17 - Erreur: end tag for "br" omitted, but OMITTAG NO was specified
    line 450 column 8 - Info: start tag was here
    line 453 column 78 - Erreur: document type does not allow element "link" here
    line 454 column 75 - Erreur: document type does not allow element "link" here
    line 458 column 61 - Erreur: document type does not allow element "hr" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag
    line 464 column 42 - Erreur: end tag for "select" which is not finished
    line 473 column 15 - Erreur: end tag for "br" omitted, but OMITTAG NO was specified
    line 473 column 6 - Info: start tag was here
    line 485 column 9 - Erreur: end tag for "br" omitted, but OMITTAG NO was specified
    line 485 - Info: start tag was here
    line 491 column 15 - Erreur: end tag for "div" omitted, but OMITTAG NO was specified
    line 40 - Info: start tag was here

If it's not a typo, your second <script> element is one closing tag short. That will most definitely not work.

It's also likely that because of this, the following <link> elements are not getting loaded properly.

If that doesn't help, <link> elements do not require a closing tag. Just skip the / for those.

The only thing I could debug was the

<script type="text/javascript" src="http://templates.kliqprint.us/js/jquery.colorbox-min.js"></script> <script type="text/javascript" src="http://templates.kliqprint.us/js/templates.js"></script><script type="text/javascript"> //Google Analytics </script>

is in the Body section

Can u trim it up and bring it to header. When I took the Raw HTML and copy pasted here is the screen that I get.

  • your doctype is wrong, use <!doctype html>
  • you are missing a closing </div>.
    Insert one before </body> and that should make your page work, although I didn't check where it's meant to be closed

I am fairly sure that the second issue is the one that is breaking IE tho, the first can be probably avoided.

The page has some XML code, which creates the problem on IE. After removing those XML code, it worked great.

发布评论

评论列表(0)

  1. 暂无评论