4

My jquery code works with Chrome, Firefox, > IE8, but it seems that jquery and jquery ui aren't loaded on IE8.

Javascript is enabled.

I use <meta http-equiv="X-UA-Compatible" content="IE=7,IE=8" />, 'cause I had some issues on IE9

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=8" />
<link href="css/my.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
<link href="css/jquery-ui-timepicker-addon.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
         $(function(){
         }); // Sorry, really it's so and not only }
</script>
</head>

Any suggestion? What I should check?

EDIT

By changing

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

to

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

resolves most of the issues on IE8.

The only issue still remains is tied to pop up:

when there is a button which triggers a pop up, clicking on pop up "OK" doesn't trigger the corresponding action (the button is inside an a tag).

4

2 回答 2

3

你试过这个吗?

<meta http-equiv="X-UA-Compatible" content="IE=8,IE=EDGE" />
于 2013-07-28T18:31:32.303 回答
0

你能把它放在一个 jQuery.Ready 函数中,看看它在浏览器之间是否更一致?我看到评论使用不同的格式提出了同样的建议:

<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=8" />
<link href="css/my.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js"></script>
<link href="css/jquery-ui-timepicker-addon.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
         $(document).ready(function(){
            // do something here...
         }); // Sorry, really it's so and not only }
</script>
</head>

..

还建议将您的 jquery、jquery-ui 和 jquery-ui css 和 jquery 验证更新到最新版本。您应该能够使用 modernizr javascript 库来检测您拥有的浏览器版本,然后应用这些元标记以满足您的需求。

链接将检测您使用modernizr 的浏览器版本。

于 2013-08-04T01:07:30.377 回答