当调用window.alert()时,脚本不应等待用户输入(例如点击确定),而应继续执行。
我如何在不使用setTimeout()函数的情况下实现这一点?
我如何在不使用setTimeout()函数的情况下实现这一点?
this.alert('Window')
console.log('Continue here, dont wait for user input on the "Window"')
alert
is blocking.. Use some custom UI to display alert instead ofwindow.alert
- Rayonconsole.time("alert"); alert("...waiting"); console.timeEnd("alert");
如果你不能阻塞,测量的持续时间应该小于1毫秒。 - ThomassetTimeout
?恐怕这也无济于事。 - Salman A