-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Back Button Behavior When No History Available #4732
Comments
"If I use data-rel="back" then it will take them back to the page that referred them to my app not to the correct previous page" What is the correct previous page here? Are you saying that the markup looks something like: <a href="/foo/bar" data-rel="back">Back</a> The major problem with this is that the link goes to two different places depending on where the user came from and we, as a library, are then dictating to users how the application should handle the behavior of a back button in their apps when there is no internal history. There may in fact be apps now that expect to be able to go back to the previous page using the back button. Leaving this open for later consideration. |
The back functionality should have priority in this case. No doubt about that. But let's say this is the first page in a new window or it's not a local page because they found the link through Google so it sends them back to Google. Maybe the best option would be if you could setup a way to have a user callback function of whether the back function should be used or not. That way I can have something like this: // If referrer isn't set or it doesn't contain mydomain.com then ignore back button functionality |
Yah it'd have to be some sort of config option and a callback makes the most sense. Definitely something we'll consider. |
I think it would be tricky to use document.referrer in the framework because that is not always reliable (depends on browser). So this could cause the back button functionality being ignored where it shouldn't. Anyway, I added your request to the wiki page (https://github.com/jquery/jquery-mobile/wiki/Feature-Requests) in the navigation section. Closing as a feature request. |
This isn't so much a bug as a feature improvement I'd like to see if possible. If a user goes directly to a page in my mobile app. Say they came to the page from google or something like that. If I use data-rel="back" then it will take them back to the page that referred them to my app not to the correct previous page. For the time being I'm just not using data-rel="back" but it would be nice to have it detect if the previous link is on the same domain or something and if it isn't then use the regular link instead.
The text was updated successfully, but these errors were encountered: