jQuery mobile - one or multiple page events?

70 views Asked by At

Almost every page in my application has it's own pageinit and pageshow function to load content and register event listeners. So since I have around 20 listeners at the end, I'm asking myself if it would be better for jqms performance to put them all together, so using

$(document).on( "pageshow", function( event, ui ) {
  //... choose action based on ui.nextPage
});

instead of

$(document).on('pagebshow', '#home', function(){
 //... doing stuff for this site
}

for every single page?

0

There are 0 answers