Solved

jQuery Ajax delay calls

Posted on 2013-01-23
1
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

726 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