3

I have the regular jQuery library attached and the jQuery mobile file attached after (jquery.mobile-1.2.0.min.js).

As soon as I attach jQuery mobile and refresh the page, I get the loading screen.

I have tried disabling it with:

$(document).on("mobileinit", function(){
    $.mobile.ajaxEnabled=false;
    $.mobile.loadingMessage = false;
});

As well as trying a different init function:

$(document).bind('pageinit'){

But neither have worked. I still just get the loading message or a completely blank screen.

The only function I really need it for is the swipe event.

Thanks in advance.

2 Answers 2

4

Mobileinit must be used before jQM js file is leaded, like this:

<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 loads.

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

2 Comments

Just to say.. There is no src to the jquery.js cdn, which needs to be before the mobileinit AND anyways didn-t solve the problem, may be deprecated...
is there any way to alter the $.mobile. option after initializing jquery-mobile js?
2

I have used CSS method. Not nicest but works and fast.

<style>
.ui-loader 
{
  display: none !important;
}
</style>

This question already answered: jQuery Mobile loading message

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.