I have the following code:
Your jQuery code never gets executed. You should run it from within jQuery's "ready" event:
$( function() { $('#mypage').live('pageshow', function (event, ui) { alert('This page was just hidden: ' + ui.prevPage); }); });