thangdragon1569
New Member
I am working on an app with jQuery mobile. I have a script that I want to start once the user enters a page and stops once they leave.I have used:\[code\]$( document ).delegate("#myPage", "pagecreate", "", function() { //my script here});\[/code\]to have the script only run once the user enters "myPage." How can I have it so the script stops once they leave "myPage"?Edit: I am using ajax-based navigation so it is all one HTML file. I am trying to start and stop a script when someone enters a new subpage (#page).