How to stop jQuery Mobile calling $.mobile.loading('hide') during changePage? -
i'm trying stop jquery mobile hiding loading spinner when changepage called. the program flow goes this, starting clicking link, has click event defined this: $('body').delegate('.library-link', 'click', function() { $.mobile.loading( 'show' ); $.mobile.changepage($('#page-library')); return false; }); upon clicking link, pagebeforeshow event fired, triggers function populate page local storage, or else make ajax call data. $(document).on('pagebeforeshow', '#page-library', function(event){ ui.populate_data(); }); in ui.populate_data() data local storage or make ajax call. ui.populate_data = function() { if (localdata) { // populate ui on page $.mobile.loading( 'hide' ); } else { // make ajax call } }; if data there, load data container , hide loading spinner. if not makes ajax call, on complete saves data in local storage, , calls ui.populate_data...