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

  • SEARCH
  • Home
  • 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 8862515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:44:54+00:00 2026-06-14T15:44:54+00:00

im developing a mobile app which is based on jqm and local storage you

  • 0

im developing a mobile app which is based on jqm and local storage

you can view it here:

clients/app2u/Apps/6/home.html
clients/app2u/Apps/6/gallery.html
clients/app2u/Apps/6/categories.html

etc’

local storage contains data for each page (for example: “app2u_app6_home”) and a general tab data (“app2u_app6_Tabs”)

the problem is that on first visit to the page, the page loads before the data is completely load, and only if you refresh the page the page will contain the data.

how can i force the page to show only after the local storage is ready?

  • 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-06-14T15:44:55+00:00Added an answer on June 14, 2026 at 3:44 pm

    Note: I am assuming you are referring to the getPageData function in functions.js on your site.

    Your problem is that the $.post call is asynchronous (unlike the call to localStorage.getItem) so your getPageData function cannot return immediately.

    Instead, you should refactor it to accept a callback function:

    function getPageData(page,wait,extra_data,callback) {
        if (localStorage.getItem(unique_param+page)) {
            callback(localStorage.getItem(unique_param+page, extra_data));
        } else {
            if (typeof(extra_data) == 'undefined') {extra_data = '';}
            $.post(server_path + 'index.php?module=API&pname=' + page + '&pmode=empg&application_id=' + application_id + extra_data,
                    function(response) {
                        localStorage.setItem(unique_param+page,JSON.stringify(response));
                        callback(response);
                    }
            ,'json'
            );
        }
    }
    

    Using this method, your code will always wait for either the call to local storage or the call to the server to complete

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing a mobile app in Android and iPhone which has a server-side
i am new livecode app developer and developing a mobile app which needs to
I'm developing a mobile-friendly web app which I would like to feature a dead-simple
I'm studying the best plataform for developing a mobile app (for Android, first) which
friends. I'm developing a flex mobile app. I've declared a Titlewindow which contains the
I'm developing a mobile application which should works like the google map navigation app.
I am developing a mobile app using HTML5, Javascript, jQuery Mobile, and offline storage.
I am developing mobile app which talks with server via PHP Webservice . This
I am currently developing a mobile app which need the current position of the
I am developing a jQuery mobile web app, which currently has two pages. First,

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.