Well, let's say I have a script of this type:
<script src="http://script.com/file.js"></script> I need it to work, for example, 3 seconds. How to put a temporary limit?
I need it to work, f...">
Well, let's say I have a script of this type:
<script src="http://script.com/file.js"></script> I need it to work, for example, 3 seconds. How to put a temporary limit?
Use WebWorker.
For example, on the Regex Golf website, the time for checking regular expression regularity is thus limited.
We SetTimeout and in it we change global variable. And in the loop we track the change in the global variable.
But so wrong. JavaScript does not work that way (you need to look towards asynchrony, events , etc.)
Source: https://ru.stackoverflow.com/questions/462984/
All Articles