Is there any way to time how long a jquery ajax request has been going on? sometimes searches take too long and it would be nice to add a jquery abort() button if the search takes over, say, 5 seconds. Any way I can do this!
On the other end of the ajax request is a php file that makes a postgresql request.
Much thanks for any ideas!
To have the abort button appear after 5 seconds, add a
setTimeoutfunction after your call tosend. Once the AJAX command is complete, you can add code to clear the timeout and remove the abort button if it exists.This way the abort button will never appear if AJAX returns quick enough.