JS settimeout not working in IE8 ...

<html> <head> <script> var i; i = 0; function loop() { i = i + 1; alert(String(i)); setTimeout("loop()",1000); } setTimeout("loop()",1000); </script> </head> <body> </body> </html> 

Try the above code in IE8, it will not give a warning message every 1 second if you hold the right mouse button.

But in firefox, it displays a warning message, even if you do not release the right click.

I want firefox functionality in IE8.

+4
source share
3 answers

The reason for this is that holding the button is a lock event. This means that all executions stop at runtime.

There is nothing you can do about it.

Do you use the right mouse button for something special other than the default context menu?

+2
source
 window.setTimeout(timeOut,1000); // timer is set in milliseconds = 1000 * sec function timeOut() { alert('1 sec passed'); } 
+1
source
 function myFunction() { setInterval(function(){alert("Hello")},3000); } myFunction(); 

more details

0
source

Source: https://habr.com/ru/post/1312285/


All Articles