andyhill Posted May 21, 2020 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
Sherzod Posted May 22, 2020 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
andyhill Posted May 22, 2020 Author 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
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.