This is an issue with Javascript executing linearly on a single thread.
using
setTimeout(function(){},time);
is evaluated and executing the function()
immediately.
I am looking for a method to execute function()
in x seconds, for example after the dom has been updated from an ajax call.
How is this done?
In other words just need to 'pause' the script and then let it know when to execute.
for clarity if you did something like this inside the function();
var a= document.getElementbyId("anid").innerHTML;
var a will be gathered at time setInterval is processed and not in x seconds when the function is executed.
Thanks...