0

Let's say that I go the page: "http://example.com/page1.php"

At page1.php an (asynchronous) AJAX call is made to "http://example.com/page1.php?action=getSomethingBig" which takes a long time (60 seconds maybe) to load.

Before the AJAX call is done (maybe I'm tired of waiting), I click a link to go to: "http://example.com/page2.php".

How do I avoid that the browser has to wait for the AJAX call to complete before going to "page2.php"?

allanth
  • 423
  • 9
  • 23

1 Answers1

0

If you are using jquery you can use the ajaxStop() function. if you use plain javascript you can use the stop() function in your XMLhttprequest object

Community
  • 1
  • 1
Dylan Reimerink
  • 5,874
  • 2
  • 15
  • 21
  • I don't this this is what I need. The function description says: "Register a handler to be called when all Ajax requests have completed." I don't want to sit and wait for it to complete. – allanth Oct 03 '14 at 07:36