Reputation: 5454
In jQuery Mobile, we can easily create a "Back" button with data-rel="back" or data-add-back-btn="true" However, is there a way for us to also pass back some custom data when user click the back button?
One common scenario is that we use Ajax to transition from page1 to page2. In page2, user performs some actions, and the results of such actions in page2 should be passed back to page1 when user clicks "Back" button.
So far, I have not being able to find a proper solutions. The plugin jquerymobile-router by azicchetti is useful when you want to ajax pass url parameters from page1 to page2 (so that page2 has some knowledge from page1). But I am not sure how it can apply in reverse (page2 back to page1)
Upvotes: 1
Views: 1356
Reputation: 4690
I would use Cookies or Sessions for this. Another possibilty could be: local storage.
Upvotes: 1