IE 仅在按 F12 后才运行 JavaScript
我在使用 JavaScript 的 Internet Explorer 中遇到了一个奇怪的问题。在我进行测试的每个浏览器中,JavaScript 均已启用,但它似乎仅在我按 F12 后才运行,并在调试模式下运行它。更令人困惑的是,启动 IE 调试器后,一切都按预期工作。
有什么想法吗?
I have a strange problem in Internet Explorer with JavaScript. In every browser I did the test the JavaScript is enabled, but it seems to run only after I press the F12, running it in debug mode. And what is more confusing, after starting the IE debugger everything is working as suppose to.
Any ideas what it could be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在调用:
或控制台的任何相关方法时未检查
window.console
是否存在,则脚本将默默失败。打开控制台会导致window.console
存在,这允许脚本继续执行。在调用
console
之前添加"window.console && "
:If you're calling:
or any related method of console without having checked if
window.console
exists, the script will fail silently. Opening the console leads towindow.console
existing, which allows the script to continue execution.Add
"window.console && "
before your calls toconsole
: