Disable loading jQuery message for mobile and AJAX
I have a regular jQuery library and a mobile jQuery file attached after (jquery.mobile-1.2.0.min.js).
As soon as I connect jQuery mobile and refresh the page, I get a loading screen.
I tried to disable it:
$(document).on("mobileinit", function(){
$.mobile.ajaxEnabled=false;
$.mobile.loadingMessage = false;
});
Also, to try another init function:
$(document).bind('pageinit'){
But none of them worked. I still get a loading message or a completely blank screen.
The only function I really need is the swipe event.
Thanks in advance.
+3
source to share
2 answers
Mobileinit must be used before the jQM js file is launched, for example:
<head>
<title>jQM Complex Demo</title>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script>
$(document).on("mobileinit", function(){
$.mobile.ajaxEnabled=false;
$.mobile.loadingMessage = false;
});
</script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
It won't work if you execute it after the script has loaded.
+4
source to share
I used CSS method. Not the nicest, but it works fast too.
<style>
.ui-loader
{
display: none !important;
}
</style>
This question has already been answered: jQuery Loading a mobile message
0
source to share