Reputation: 3999
Here's my situation:
I have two pages. I use this line of code to execute things when a user changes between the two pages. It works, but only when I am loading a page for the first time. If I am returning to a previous page (one that I already visited), it doesn't call this method.
$('div:jqmData(role="page")').live('pagebeforeshow',function(){ ... });
For example:
Any reason why that would happen?
Upvotes: 0
Views: 1613
Reputation: 76003
Here is a demonstration I made for you to show when events fire for pages in the jQuery Mobile framework (version 1.0): http://jsfiddle.net/jasper/QjtZW/1/
When you navigate to different pages the pageshow
event always fires on the page being shown as you can see in my example.
If you are having issues with pageshow
firing as it should then you probably have an error or some errors in your code that are blocking code from running. Make sure your error console is clear.
Upvotes: 1