简单的 jQuery 在 IE 中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14505714/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Simple jQuery not working in IE
提问by fluxus
I jsut now noticed that some simple jQuery is not working on IE9 and IE10 for mobile. I have some copyright links and simple sliding contact form which uses animate(). Also I use scrollTo plugin in combination with jQuery. I tried different versions, and still no solution. Maybe I am missing something obvious.
我现在注意到一些简单的 jQuery 不适用于 IE9 和 IE10 移动版。我有一些版权链接和使用 animate() 的简单滑动联系表单。此外,我将 scrollTo 插件与 jQuery 结合使用。我尝试了不同的版本,仍然没有解决方案。也许我错过了一些明显的东西。
Here is the code for one copyright link and for contact form to open and close.
这是一个版权链接和用于打开和关闭联系表格的代码。
$('#privacy').click(function(){
$('#copyright').hide('fast');
$('#policy').toggle('slow');
$.scrollTo('+=800px', 800, { axis:'y' });
});
$('#plusSign').click(function(){
if ($('#contactFormHolder').hasClass('active')){
$('#contactFormHolder').animate({top:'-200px'},1000).removeClass('active');
}else{$('#contactFormHolder').animate({top:'0px'},1000).addClass('active');}
});
You can check it live on http://www.crazysunsets.com
采纳答案by darshanags
Your markup is invalid, specifically the script tag format:
您的标记无效,特别是脚本标记格式:
Change:
改变:
<script type="text/javascript ">
To:
到:
<script type="text/javascript">
Remove the space after 'javascript'
删除“javascript”后的空格
Cheers!
干杯!
回答by Ali Rasouli
goto bottom path:
tools menu=>internet Option=>Advanced Tab=>in setting list=>in browsing group
转到底部路径:
工具菜单=>互联网选项=>高级选项卡=>在设置列表中=>在浏览组中
unchecked the "Disable script debbugging(ie)" and "Disable script debbugging(others)" options(checkboxes). now refresh page. ie send error line and error name for you!
取消选中“禁用脚本调试(即)”和“禁用脚本调试(其他)”选项(复选框)。现在刷新页面。即为您发送错误行和错误名称!