简体   繁体   English

IE上的Javascript奇怪行为

[英]Javascript strange behavior on IE

I noticed a strange behavior of IE (any version : 7, 8 or even 9) when executing JavaScript : Drag and drop don't work, but when I press F12 button twice it work perfectly (F12 developer tools) 我在执行JavaScript时注意到IE(任何版本:7,8或甚至9)的奇怪行为:拖放不起作用,但是当我按两次F12按钮时它完美运行(F12开发人员工具)

On Chrome, all code work in perfection, but in IE I should press F12 twice to let code run perfectly. 在Chrome上,所有代码都完美无缺,但在IE中我应该按两次F12才能让代码完美运行。

Can anyone explain what is this bug? 任何人都可以解释这个错误是什么?

I guess its because you are using console.log in your code 我猜是因为你在代码中使用了console.log

console.log is available after you open Developer Tools in IE. 在IE中打开开发人员工具后,可以使用console.log。 Use a try catch; 使用try catch;

try{
    console.log('log')
}
catch(err){
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM