Skip to content
This repository has been archived by the owner on Jul 28, 2018. It is now read-only.

Abort in-progress page fetch? #155

Closed
pospischil opened this issue Jan 5, 2013 · 4 comments
Closed

Abort in-progress page fetch? #155

pospischil opened this issue Jan 5, 2013 · 4 comments

Comments

@pospischil
Copy link

Is there an easy way to abort an in-progress page fetch when a (turbo)link is clicked?

Here is the scenario:

  • User viewing Page A
  • User clicks link to go to Page B (server takes 2000ms to respond)
  • before server has responded with Page B, user clicks a different link, to Page C (server responds in 25ms)
  • Page C loads
  • Server finishes loading Page B, page contents change to that of Page B

Ideally, I'd like to have the response for Page B be ignored, but I don't see an easy way to do so...Am I missing something? Is this intended behavior?

@davydotcom
Copy link
Contributor

Good idea, we can do this with an xhr.abort();

@dhh
Copy link
Contributor

dhh commented Jan 11, 2013

@davydotcom You're going to take a swing at this?

@davydotcom
Copy link
Contributor

sure why not ;) should be just a few lines

@davydotcom
Copy link
Contributor

closable @dhh

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants