简体   繁体   English

jQuery在IE9中无法正常工作/渲染

[英]Jquery not working/rendering in ie9

I have looked everywhere and cant seem to find an answer that works for my problem. 我四处张望,似乎找不到解决我问题的答案。 I have got my site working in ie 6, 7 ,8 ,10, firefox and chrome and then i looked on ie9 and almost passed out. 我让我的网站在6、7、8、10,firefox和chrome中工作,然后我在ie9上看了几乎被淘汰了。 The styling was broken and none of the jQuery was working. 样式已损坏,jQuery均无法正常工作。

I have added in the ie8 compatibility mode and that seems to have sorted my styling issue: 我添加了ie8兼容模式,这似乎解决了我的样式问题:

meta http-equiv="X-UA-Compatible" content="IE=8" />

However this has still not sorted my jquery issue. 但是,这仍然没有排序我的jQuery问题。 Its as if its not registering that there is any such thing as jQuery. 好像没有注册jQuery之类的东西。 I have read articled saying that it has to be jquery v 1.6 or later, and consequently i am using: 我已经读过文章说它必须是jquery v 1.6或更高版本,因此我正在使用:

script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">

I am just baffled as to how it works perfectly in all the other browsers and then ie9 has lost the plot. 我只是困惑于它如何在所有其他浏览器中完美地工作,然后ie9失去了图谋。 Thanks everyone. 感谢大家。

Quick fix to display stylesheets in IE9 ... In this case I was using a Jquery mobile style sheet with a full URL reference to the stylesheet. 在IE9中显示样式表的快速修复...在这种情况下,我使用的是带有样式表的完整URL引用的Jquery移动样式表。 But regardless try using the following code and relatively referencing your stylesheet ... IE9 began to work correctly: 但是无论尝试使用以下代码并相对引用您的样式表... IE9都可以正常工作:

<!--[if lt IE 9]>
    <link rel="stylesheet" type="text/css" href="jquery.mobile-1.0.1/jquery.mobile-1.0.1.min.css">
<![endif]-->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM