2

I have a page that loads 2 drop down menu with AJAX. Then it loads a third AJAX that can take over 30 seconds to load. (slow SQL query).

When user selects items from the 2 drop downs the third slow AJAX is fired again to list the results.

All works fine on first load. But if I refresh the page or if user selects a different option while the third ajax is still loading, the page hangs until the third ajax has been loaded.

I have tried to .abort() the load, but that does not seem to help. The browser waits for the aborted file to load before loading ajax 1&2 and 3.

I added the abort to onbeforeunload but that does not help the page refresh problem.

I have tried this using pure JavaScript and jQuery but get same results.

The server is IIS6 and the XML output is from asp pages.

Is there any way to get around this?

Kara
  • 6,115
  • 16
  • 50
  • 57

1 Answers1

0

Abort Ajax requests using jQuery

This should help you in aborting the ajax call. Just check on which ajax call you are actually calling abort() function.

On the side note, just check whether your browser is getting hung because of other processes running in your system. Because, every ajax request that is fired will start a db query and that may also give you a hung feel.

Community
  • 1
  • 1
LPD
  • 2,833
  • 2
  • 29
  • 48