Closed rmanalan closed 13 years ago
When pagebeforeshow is triggered, the target page will have a data-url attribute on it containing the filepath from which it was retrieved. Does that help?
$("div").live("pagebeforecreate", function(){
var url = $(this).jqmData("url");
});
This works. Thanks.
On Thu, Mar 31, 2011 at 7:38 PM, scottjehl < reply@reply.github.com>wrote:
When pagebeforeshow is triggered, the target page will have a data-url attribute on it containing the filepath from which it was retrieved. Does that help?
$("div").live("pagebeforecreate", function(){ var url = $(this).jqmData("url"); });
Reply to this email directly or view it on GitHub: https://github.com/jquery/jquery-mobile/issues/1325#comment_943975
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:
Is there a better way to do this? If not, can we have something set inside of $.mobile that gives us the same info?