【发布时间】:2013-07-19 04:59:21
【问题描述】:
我的 jquery 代码适用于 Chrome、Firefox、> IE8,但在 IE8 上似乎没有加载 jquery 和 jquery ui。
Javascript 已启用。
我使用<meta http-equiv="X-UA-Compatible" content="IE=7,IE=8" />,因为我在 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>
有什么建议吗?我应该检查什么?
编辑
通过改变
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=8" />
到
<meta http-equiv="X-UA-Compatible" content="IE=8" />
解决了 IE8 上的大部分问题。
唯一仍然存在的问题是弹出窗口:
当有触发弹窗的按钮时,点击弹窗“OK”不会触发相应的动作(按钮在a标签内)。
【问题讨论】:
-
不应该是
$(function(){ //code here });还是(function($){})(jQuery);? -
“在 IE8 上没有加载” - 为什么没有加载? Javascript 控制台中是否有一些错误?
-
不要忘记点击答案左上角的复选标记来接受正确答案
-
所以....这仍然是一个问题吗?修复错字是否解决了问题?查看您的代码,我认为它没有理由在 IE8 中不起作用。
-
您也可以在
IE8中按f12、check How to use F12 Developer Tools to Debug your Webpages, if needed 进行调试。
标签: javascript jquery button internet-explorer-8 popup