Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7192331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:55:05+00:00 2026-05-28T19:55:05+00:00

I’m using following code to show loading message in JQuery mobile. But the loading

  • 0

I’m using following code to show loading message in JQuery mobile. But the loading is not shown? I couldn’t figure out the issue. Thanks for your time in advance.

$("#AccountListPage").live('pageinit', function (event) {

   // alert('test');

    $.mobile.showPageLoadingMsg();

    listAccounts();

    $.mobile.hidePageLoadingMsg();

    //alert("Add Test");
});

When the comments are removed, the alerts work fine.

listAccount function

function listAccounts() {

    var soapMessage =
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">\
  <soap:Body>\
    <ReadByOrgID xmlns="http://eyepax.crm.com/Organization">\
      <OrganizationID>' + OrganizationID + '</OrganizationID>\
      <ConfigurationCode>' + ConfigurationCode + '</ConfigurationCode>\
      <Flag>' + Flag + '</Flag>\
      <LicenceOrganizationID>' + LicenceOrganizationID + '</LicenceOrganizationID>\
    </ReadByOrgID>\
  </soap:Body>\
</soap:Envelope>';
    soapMessage = $.trim(soapMessage);
    //$.mobile.pageLoading(true);
    $.mobile.showPageLoadingMsg();
    $.ajax({
        url: selectParentAccUrl,
        type: "POST",
        dataType: "xml",
        data: soapMessage,
        crossDomain: true,
        success: endListAccounts,
        error: function (jqXHR, textStatus, errorThrown) {
            $.mobile.hidePageLoadingMsg();
            alert("failure");
            console.log(textStatus);
            console.log(errorThrown);
        },
        contentType: "text/xml; charset=\"utf-8\""
    });

    return false;
}

function endListAccounts(xmlHttpRequest, status) {
    var testsss;

    console.log(xmlHttpRequest);
    console.log(status);
    console.log(Date());


    //testsss = $(xmlHttpRequest).find("Table OrganizationName:eq(0)").text();
    var result = $(xmlHttpRequest).find("OrganizationName").length
    //result = 3;

    var htmlString="";

    for (i = 0; i < result; i++) {
        htmlString = htmlString + "<li><a href='AccountDetails.html' onclick='AccountIndex="+i+"'>" + $(xmlHttpRequest).find("Table OrganizationName:eq(" + i + ")").text() + "</a></li>";


        accountConstructor($(xmlHttpRequest).find("Table OrganizationID:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table ParentID:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table OrganizationName:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table IncorporationNo:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table POBoxAddress:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table PhysicalAddress:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table VisitSwithboard:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table VisitFax:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table www:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table Active:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table MotherCompany:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table AccountManager:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table AccountManagerID:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table VisitCountryID:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table CountryID:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table CategoryCount:eq(" + i + ")").text(),
        $(xmlHttpRequest).find("Table ContactCount:eq(" + i + ")").text())
    }
    //alert(testsss);
    console.log('orgID : ' + testsss);
    console.log('count : ' + result);
    var b = $(xmlHttpRequest).find('vstrError').text();
    console.log('vsserr : ' + b);
    //alert('vssr : ' + b);
    $('#account_list').append(htmlString);
    $("#account_list").listview("refresh");
    console.log('account : ' + AccountArray[1].OrganizationName);
    //$.mobile.hidePageLoadingMsg();
    //$.mobile.pageLoading(true);
    $.mobile.hidePageLoadingMsg();
    // window.location = 'index.html';
    //$.mobile.changePage('index.html');

}

html page

<!DOCTYPE html> 
<html> 

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title></title> 
    <link rel="stylesheet" type="text/css" href="assets/jquery.mobile-1.0.css" />

</head> 

<body> 

<div data-role="page" id="AccountListPage">

    <div data-role="header">
        <h1>CRM Mobile App</h1>
        <a href="Account.html" data-icon="arrow-l">Back</a>
    </div><!-- /header -->
<div data-role="content">

<ul data-role="listview" data-inset="true" data-filter="true" id='account_list'>

</ul>


</div><!-- /content -->
    <div data-role="footer">
        <small>&#169; 2011 EyePax IT Consulting</small>
    </div><!-- /footer -->



</div><!-- /page -->
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:55:07+00:00Added an answer on May 28, 2026 at 7:55 pm

    I’m assuming that the listAccounts() function does something asyncronously, like an AJAX request or an animation.

    If that is the case then you need to put $.mobile.hidePageLoadingMsg() in the callback function for your the asyncronous code in the listAccounts() function. The reason is that the $.mobile.hideLoadingMsg() is running right after the $.mobile.showLoadingMsg() function, so close that it probably never gets drawn.

    Here is an example of using the loading message with an AJAX call

    function listAccounts () {
        $.mobile.showPageLoadingMsg();
        $.ajax({
            url : '<url>',
            success : function () {
                $.mobile.hidePageLoadingMsg();
            }
        });
    }
    
    $(document).delegate('#AccountListPage', 'pageinit', function () { 
        listAccounts(); 
    }); 
    

    Using Global AJAX Events to Your Advantage

    You can setup global AJAX events in jQuery so everytime an AJAX request is sent, the loading message is shown (and removed when the AJAX request completes):

    function listAccounts () {
        $.ajax({
            url : '<url>'
        });
    }
    
    $(document).delegate('#AccountListPage', 'pageinit', function () { 
        listAccounts(); 
    }).ajaxStart(function () {
        $.mobile.showPageLoadingMsg();
    }).ajaxComplete(function () {
        $.mobile.hidePageLoadingMsg();
    });
    

    An example of using the loading message with an animation

    function listAccounts () {
        $.mobile.showPageLoadingMsg();
        $('#ani-element').stop().animate({
            WebKitTransform : 'scale(3)'//this cales the `#ani-element` DOM element to three times it's size in webkit browsers
        }, 500, function () {
            $.mobile.hidePageLoadingMsg();
        });
    }
    
    $(document).delegate('#AccountListPage', 'pageinit', function () { 
        listAccounts(); 
    }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am reading a book about Javascript and jQuery and using one of the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.