This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes timeout in ajax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "timeout in ajax" Watch "timeout in ajax" New topic
Author

timeout in ajax

Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi guys,
Is it possible to set a timeout option for ajax ? like after 4secs of xmlhttprequest processing....say "requets timed out..."

Please give me some tips on this..

Thank you
Balaji


Spritle Software Blogs
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
you can use the abort() method to cancel the request.

YourAjaxObjectReference.abort();

Eric
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Thanks Eric... I will try it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: timeout in ajax