Disable jQueryMobile loading error message by default

can I just disable the "error load page" message in jQueryMobile? I have the following in my head: a) a message still appears. b) the text is incorrect

<script> $(document).bind("mobileinit", function(){ $.mobile.pageLoadErrorMessage = 'coming right up!'; }); $(document).bind("mobileinit", function(){ $.mobile.pageLoadErrorMessage = true; }); </script> 
+4
source share
4 answers

When handling the jQuery Mobile "mobileinit" event, you can turn off the display of the error message. To handle the "mobileinit" event, create a custom- script.js file as follows:

 $(document).bind("mobileinit", function(){ $.extend( $.mobile , { pageLoadErrorMessage: "" }); alert("mobileinit received"); }); 

Then specify the file BEFORE the jQuery Mobile script tag:

 <script type='text/javascript' src='libs/jquery-1.8.3.js'></script> <script type='text/javascript' src="js/custom-script.js"></script> <script type='text/javascript' src="libs/jquery.mobile-1.2.0.min.js"></script> 

This is all that is required to suppress a message.

+5
source

You can hide it with css, for example:

 div.ui-loader.ui-overlay-shadow { display: none !important; } 
+1
source

http://jquerymobile.com/demos/1.1.0-rc.1/docs/api/globalconfig.html

See page LoadErrorMessage area

Hopefully if you set it to blank, the page will not display.

0
source

I use this to target an error message, but not the default download icon icon

 .ui-loader.ui-body-e { left:-9999px;} 

You can call it for display to check css in this way

 $(".ui-loader").show() 

There is a known iOS bug where you get this for successful ajax calls (they return 0 instead of 200, obviously)

0
source

Source: https://habr.com/ru/post/1401883/


All Articles