JavaScript 不适用于 Internet Explorer 10

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16804718/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 06:02:46  来源:igfitidea点击:

JavaScript not working on Internet Explorer 10

javascriptinternet-explorer-10

提问by ray.gurganus

I'm on Windows 7, and just upgraded IE to 10. It works fine, except that Javascript isn't working. I know that it is enabled, as I can go into the settings and disable it, and then I get the "no js" output. But with it enabled, I get nothing. No errors in the JS console. The same script in Firefox gives me "hello".

我在 Windows 7 上,刚刚将 IE 升级到 10。它工作正常,除了 Javascript 不工作。我知道它已启用,因为我可以进入设置并禁用它,然后我得到“无 js”输出。但是启用它后,我什么也得不到。JS 控制台中没有错误。Firefox 中的相同脚本给了我“你好”。

Browser Mode is "10" and Document Mode is "Standards", though changing these doesn't yield anything different. Here is the entire page:

浏览器模式为“10”,文档模式为“标准”,但更改这些不会产生任何不同。这是整个页面:

<!DOCTYPE HTML>
<html>
  <body>
<script type="text/javascript">
document.write('hello');
</script>
<noscript>no js</noscript>
  </body>
</html>

Similar results on other websites -- if I go to a page that uses Disqus comments, I just get a blank space. If JS were disabled, Disqus would return a message saying so.

其他网站上的类似结果——如果我转到使用 Disqus 评论的页面,我只会得到一个空白区域。如果 JS 被禁用,Disqus 会返回一条消息说这样。

Thanks.

谢谢。

回答by user2192293

I solve this problem. F12 -> Disable -> Script (uncheck)

我解决了这个问题。F12 -> 禁用 -> 脚本(取消选中)

回答by Terry

I don't know if this will fix your problem but your markup is invalid, run it through the W3C Validatorto fix the problems then try again.

我不知道这是否会解决您的问题,但您的标记无效,请通过W3C 验证器运行它以解决问题,然后重试。