I need this too.
I can't use the page change function I don't think because I don't want it to happen all the time.
basically I am creating a menu item with ajax and redirecting to the new item once the request succeeds using changePage. Obviously the menu on the new page reflects the changes. But if I click the back button I go to the cached page which does not have the new menu item in it so it looks like the menu creation did not work properly- to the average user.
So I need it to be that when I changePage from my ajax success function, once the transition is complete, all non active pages in the dom are removed.
I tried putting the changePage in an if but that doesn't fire- I don't want to use pageCreate or init or whatever since I don't want this to happen normally, only as a resuly of the menu item creation function...
Any ideas?
Since this is an old post I have also started a new thread with this as a question- appologies if this is not good practice ...