I want to set a JS function running, but not wait for the response. The only way I can think to do it is:
setTimeout(function() {
myFunc();
},0);
But that seems... inefficient at best. Any ideas?
You might want to look at webworkers
Why is that inefficient?
Also, don't forget that browser javascript is single-threaded. So, while your function runs, you will implicitly wait for it to return.
(async ajax calls may be an exception here)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With