本文介绍了如果用户使用IE8浏览,则禁用脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果用户使用Internet Explorer 8进行浏览,我想要一个javascript代码来禁用我创建的脚本。
i want a javascript code to disable the script i made if the user is browsing using Internet explorer 8.
推荐答案
尝试这个。
用于禁用IE 8的脚本
For disabling script for IE 8
<!--[if !(IE 8)]><!-->
<script src="path/to/external/script"></script>
<script>
// your inline script goes here
</script>
<!--<![endif]-->
用于禁用IE 8及以上版本的脚本
For disabling script for IE 8 and above
<!--[if !(gte IE 8)]><!-->
<script src="path/to/external/script"></script>
<script>
// your inline script goes here
</script>
<!--<![endif]-->
阅读bobince的答案:
Read bobince's answer: Conditional comment for 'Except IE8'?
这篇关于如果用户使用IE8浏览,则禁用脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!