5

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>

4 Answers 4

6

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.

Sign up to request clarification or add additional context in comments.

Comments

1

You can hide it with css, like this:

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

Comments

0

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

See pageLoadErrorMessage area

Hopefully, if you set it to blank, the page wont show.

Comments

0

I use this to target the Error message but not the default loading widget icon

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

You can trigger it to display to inspect the css like so

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

There is a known iOS bug where you get this for ajax calls that succeed (they return 0 instead of 200 apparently)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.