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,438
  • 68
  • 55
  • 126
Don P
  • 55,051
  • 105
  • 280
  • 411

0 Answers0