I'm building offline application with Phonegap + JQM. Is there any possibility to set globally that on every page change event would showing loading message?
            Asked
            
        
        
            Active
            
        
            Viewed 3,638 times
        
    2 Answers
0
            
            
        $(document).live('pagebeforehide', function(){
    $.mobile.showPageLoadingMsg();
    //More stuff to do
});
$(document).live('pageshow', function(){
    //More stuff to do
    $.mobile.hidePageLoadingMsg();
});
        Peter Ajtai
        
- 56,972
 - 13
 - 121
 - 140
 
        Nirmal Patel
        
- 5,128
 - 8
 - 41
 - 52
 
- 
                    I'got this kind error then I launched this soliution "Uncaught TypeError: Object #
has no method 'hidePageLoading'" – Robertas Setkus Jun 22 '12 at 08:36 
0
            
            
        Nirmal's answer doesn't work for me, but binding to the individual pages does:
$("div[data-role='page']").live('pagebeforehide', function(){
    console.log("showing....");
    $.mobile.showPageLoadingMsg();
    //More stuff to do
});
$("div[data-role='page']").live('pageshow', function(){
    //More stuff to do
    console.log("hiding....");
    $.mobile.hidePageLoadingMsg();
});
        Peter Ajtai
        
- 56,972
 - 13
 - 121
 - 140