pagebeforecreate


pagebeforecreate eventversion added: 1.0

Description: Triggered on the page being initialized, before most plugin auto-initialization occurs.

  • jQuery( ".selector" ).on( "pagebeforecreate", function( event ) { ... } )

1
2
3
$( "#aboutPage" ).on( "pagebeforecreate", function( event ) {
alert( "This page was just inserted into the dom!" );
});

Note that by binding to pagebeforecreate, you can manipulate markup before jQuery Mobile's default widgets are auto-initialized. For example, say you want to add data attributes via JavaScript instead of in the HTML source, this is the event you'd use.

1
2
3
$( "#aboutPage" ).on( "pagebeforecreate", function( event ) {
// manipulate this page before its widgets are auto-initialized
});