I created a series of $.post in sequence wherein the next $.post is loaded as callback when the load is completed.
$.post("test", function() {
alert("success");
})
.complete(function() {
//LOAD NEXT SEQUENCE OF POST HERE
});
My problem is that what if my first sequence loads in 2mins, then I need to wait for 2 mins for the next post. What I want to do is the even though the lst sequence is not yet complete, after five seconds, the next load will be executed. I’ve read about the $.ajax timeout but I don’t want it to stop executing the call from the server…. I just want to make sure that the next sequence will be loaded after a timeout of 5 secs.
Is this possible?
Thank you.
You can use setInterval function