0

I have a page where a person can query a large database (often can take half a minute or more). I want to do the following:

  1. User tries to navigate away from page.
  2. Show a dialogue confirming they wish to leave the page and lose their query progress. (Use beforeunload)
  3. If the user clicks "confirm", then I want to kill the query (via AJAX) before allowing them to navigate away. (use unload, but how can I get the page to not exit before ajax completes?)

Is this possible?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Don P
  • 60,113
  • 114
  • 300
  • 432

0 Answers0