+ 7
Why timeout for a link can't be set more than 5 seconds?
11 odpowiedzi
+ 4
Павел Сливенко That's because the current environment blocks the popup event. And so do most browsers. The browser/environment expects a real user-action for popup event but if it's triggered by some time later by setTimeout, it doesn't consider it to be a user action and blocks the popup. In browsers this type of code will not work after 2 may be 3 seconds I'm not sure.
+ 5
I can make it less than 5 seconds. Otherwise code doesn't work. Try it yourself. Thanks for comment!
https://code.sololearn.com/WfN0x9o5m536/?ref=app
+ 3
Change line 3 in JS section to a different number
Your script in HTML and JS section do not cooperate accordingly ...
+ 3
yes. and in 5 seconds it opens another code in python. How to make timeout for 10 seconds?
+ 3
So it is done internally and nothing you can do about it. At least I couldn't some time ago when I was trying to do same thing.
+ 3
Artur,
Thanks for sharing 👍
I didn't know that
+ 3
Timeout function performs itself.
+ 2
i tried making it more than 5s but it still works
+ 2
Excellent. May be other devices do not have that problem. Thank you for commenting.
+ 1
The code is supposed to vibrate a device after the cat image was clicked? am I getting the purpose correctly?
+ 1
How am I going to perform it