Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable the default jQueryMobile error loading page message

is is possible to just disable the "error loading page" message in jQueryMobile? i have the following in my head and a) the message still shows up. b) the text isn't correct

<script>
$(document).bind("mobileinit", function(){
  $.mobile.pageLoadErrorMessage = 'coming right up!';
});
$(document).bind("mobileinit", function(){
  $.mobile.pageLoadErrorMessage = true;
});
</script>
like image 323
Julian Miller Avatar asked Mar 16 '12 19:03

Julian Miller


2 Answers

By handling jQuery Mobile's 'mobileinit' event you can suppress the error message from displaying. To handle the 'mobileinit' event, create a file, custom-script.js like this:

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

Then reference the file BEFORE your 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>  

That's all it takes to suppress the message.

like image 162
The Rockncoder Avatar answered Sep 29 '22 21:09

The Rockncoder


You can hide it with css, like this:

div.ui-loader.ui-overlay-shadow { display: none !important; }
like image 25
Pablo Avatar answered Sep 29 '22 23:09

Pablo