-1

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.

Omar
  • 32,302
  • 9
  • 69
  • 112
David Leal
  • 43
  • 1
  • 5

1 Answers1

0

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/

m59
  • 43,214
  • 14
  • 119
  • 136
spezzino
  • 664
  • 12
  • 21