Need to know the url that changePage is going to beforepageshow/create

Need to know the url that changePage is going to beforepageshow/create

In my phonegap app, I have pages that execute page specific JS when the page is loaded. Some of them have a need to know the query params used to get that page. Using location.href won't work since the hashChange hasn't happened yet when the page specific js is called. Similar to $.mobile.activePage, I think it would be useful to have a way for devs to access the location.href of the page that is being fetched.

Currently, I have workaround this by setting a property on my global object:

wc.currentHref = location.href; $('a').live('vclick', function() { wc.currentHref = $(this).attr('href'); }); 

Is there a better way to do this? If not, can we have something set inside of $.mobile that gives us the same info?