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 8476241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:07:32+00:00 2026-06-10T18:07:32+00:00

I´m working on an app using PhoneGap, JQuery I have 2 standard javascript functions.

  • 0

I´m working on an app using PhoneGap, JQuery

I have 2 standard javascript functions.

LoadLanguage() will make an Ajax call to get a language file and then set up a Javascript object.

SetLanguage() will use the previous object (set in LoadLanguage()) and then set some variables with the correct language.

So in my js file i have this code:

function LoadLanguage()
{
    ....make ajax call and set up an object
}

function SetLanguage()
{
    ....set language based of previous LoadLanguage()
}

$( '#startpage' ).live( 'pagebeforecreate',function(event)
{
    LoadLanguage();
    ....
}

$( '#startpage' ).live( 'pagebeforeshow',function(event)
{
    SetLanguage();
    ....
}

Problem is that the SetLanguage() will fire before LoadLanguage() is done. I could solve this problem running SetLanguage() inside the LoadLanguage ajax.complete. But this is not good since i need to call SetLanguage() in other parts of my code.

So how do i solve this in a good way?

  • 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-10T18:07:34+00:00Added an answer on June 10, 2026 at 6:07 pm

    You need to call the SetLanguage() function once the ajax request is completed and response is received.
    if you are using jquery then in LoadLanguage function where you are making ajax request

    success: function(response)
    {
        SetLanguage();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a mobile app using Phonegap (1.4.1) / JS (jQuery Mobile 1.0)
I'm working on a mobile phone app using jQuery mobile and phonegap. I'm using
I have developed android phonegap app using html and jquery.I need to show tooltip
I am using jQuery Mobile for my PhoneGap app in Xcode. I have created
I m developing app using android-phonegap . its working fine when i call webservice
I'm working on a HTML5 + jQuery app for Android using phonegap. When I
I have been working on an Android app using Phonegap and now would like
I am working on an app for android using phonegap and unity. I wrote
I'm developing an iOS app. Its working properly on simulator. I'm using phonegap and
I'm using ShareKit to post to Facebook from a PhoneGap app which I'm working

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.