Solved

jQuery Ajax delay calls

Posted on 2013-01-23
1
338 Views
Last Modified: 2013-02-13
I've got product filtering on my webpage whereby clicking checkboxes sends a new call for the products filtered by the selection.
But I don't want to allow multiple calls being made one after the other
What is the best way to delay the call by say 1 second? A timeout?
The ajax call should be cancelled if another ajax call is initiated.
0
Comment
Question by:Gary
1 Comment
 
LVL 12

Accepted Solution

by:
sivagnanam chandrakanth earned 500 total points
ID: 38813166
There are two ways of doing it..

one is to abort the previous call and the other is by showing a div container as loading and allowing to click anything by

see both examples

http://stackoverflow.com/questions/3312960/jquery-abort-ajax-request-before-sending-another

http://stackoverflow.com/questions/9331161/prevent-other-links-from-working-during-ajax-call
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now