Q:

jQuery Mobile - pageinit and pagecreate only firing once

I am working on my first jQuery Mobile project and have encountered a roadblock. I am using Version 1.0 and so far the project is very simple, three pages with script only on the index. I incorrectly used $(document).ready(function() { ... }); at first and then read in the documentation that the correct thing to do is bind pageinit or pagecreate. Here is the script I am working with for testing purposes (straight off of the docs):
$("#main").live('pageinit', function(event) {
        alert( 'This page was just enhanced by jQuery Mobile!' );
});

I have tried this both as an external JS file and a script within the #main DIV, as suggested in some older threads I've found on here. This works when the index is loaded the first time, but when the user navigates to another page and then returns (revisits), it does not fire again.
What am I missing?

A:

pageshow will fire each time a page is shown, either on the initial page-load or when the user navigates away and then navigates back to that page.
Here is an example of using pageshow to run code on each view of a page: http://jsfiddle.net/jasper/DHeva/ (Note that this code is being run just before the closing </body> tag and is not encapsulated in a $(document.ready(function () {...}); function).
Here is a documentation link for jQuery Mobile Events (which clearly explain when each of them fires): http://jquerymobile.com/demos/1.0/docs/api/events.html (about half-way down the page starts the page events).

