andyhill Posted May 21, 2020 Share Posted May 21, 2020 I have a WebApp built around the Canvas Object (both Desktop and Mobile). I need to clear the Ajax Event Queue before firing a particular Ajax Event, please advise how - thanks in advance. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 22, 2020 Share Posted May 22, 2020 4 hours ago, andyhill said: I need to clear the Ajax Event Queue before firing a particular Ajax Event Please explain in more detail. Quote Link to comment Share on other sites More sharing options...
andyhill Posted May 22, 2020 Author Share Posted May 22, 2020 When many Ajax Events are in the queue and each one when run takes time, I decide based on a particular user action at runtime I no longer want the remaining unrun queued events to run, I therefore need to STOP AND REMOVE ALL QUEUED EVENTS (DELETE). eg. while (!q.isEmpty()) { q.dequeue(); } $(selector).clearQueue(queueName) var stack = []; //put value on top of stack stack.push(1); //remove value from top of stack var value = stack.pop(); var queue = []; //put value on end of queue queue.push(1); //Take first value from queue var value = queue.shift(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.