Reputation: 367
I have a login page and would like to show the spinner while the web page calls an ajax function to load data, when that is finished it calls chagePage and everything loads fine, except no spinner ever shows. I got the timeout from the other questions, it works if I'm debugging and stepping through but not live. I've also tried putting it in the beforeSend of the ajax.
$('#loginButton').live('click',function(e){
$.mobile.showPageLoadingMsg();
setTimeout(initialLogin(),300);
});
Thanks!
if(success){
//Load home page
$.mobile.changePage("#second");
loadList(); //loads listview
}
FYI here are the settings I'm using
$(document).bind("mobileinit", function(){
$.mobile.defaultPageTransition = 'none';
$.mobile.buttonMarkup.hoverDelay= 250;
$.mobile.allowCrossDomainPages = true;
$.support.cors = true;
$.mobile.pushStateEnabled = false;
$.mobile.orientationChangeEnabled = true;
});
Upvotes: 0
Views: 980
Reputation: 367
It's working fine now, I set the ajax async to true and fill the objects in the success area.
Upvotes: 0
Reputation: 94
You can use it application wide like this:
$(document).ajaxStart(function () {
$.mobile.showPageLoadingMsg();
}).ajaxStop(function () {
$.mobile.hidePageLoadingMsg();
});
Upvotes: 1