I have a multipage template in Jquery Mobile, but I'm trying to run an script (an alert for example) after load a page of this template.
The navigation into pages works with "#page1, #page2..."
Thanks a lot.
I have a multipage template in Jquery Mobile, but I'm trying to run an script (an alert for example) after load a page of this template.
The navigation into pages works with "#page1, #page2..."
Thanks a lot.
You can listen for pagebeforeshow
or pageload
event for example.
$(document).on("pagebeforeshow", function() {
alert($.mobile.activePage.attr('id')); //this will get the active page id (like #page1)
});
here is a list of all events http://api.jquerymobile.com/category/events/