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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:58:43+00:00 2026-06-10T07:58:43+00:00

I have created a phonegap app which calls a web service on initialization (onload

  • 0

I have created a phonegap app which calls a web service on initialization (onload of index.html). I am making the call using

 $.ajax({
  type: "GET",
  url: "http://webserviceurl.com/service",
  cache: false,
  async: true, 
  success: onSuccess,
  error: onError,
  timeout: 40000
});

Now if the webservice is not available, the service call waits for 40 seconds (limit I set as timeout) and transfers the control to onError message, which inturn shows a simple alert message for error.

But my problem is, app shows a blank screen and doesn’t show the html page untill the service call finishes (40 seconds). I want the webservice call to execute at backend and doesn’t effect loading of actual app (I thought async:true will help, but that does not).

Any ideas how can I make my app independent of webservice call?

Edit
This worked

function appReady(){
      // do the ajax here
}

document.addEventListener("deviceready", appReady, false);
  • 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-10T07:58:45+00:00Added an answer on June 10, 2026 at 7:58 am

    Can you do that like this

    $(document).ready(function() {
    
    $.ajax({
      type: "GET",
      url: "http://webserviceurl.com/service",
      cache: false,
      async: true, 
      success: onSuccess,
      error: onError,
      timeout: 40000
    });
    
    });
    

    Now your ajax query will be made after document is ready (fully loaded)

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

Sidebar

Related Questions

I have created an app using phonegap, which uses web services to update the
I have created a minimal PhoneGap app that has just this in the index.html:
I have created android phonegap app using html,css,javascript and jquery.When i hit the back
I develop an app using PhoneGap. I got a service which is in background
I have created an app for android using phonegap, but I am worried about
i have created an app in android using JNI,NDKand phonegap Plugin fr android. Here
I am using jQuery Mobile for my PhoneGap app in Xcode. I have created
I have created a phonegap app which needs to communicate with a self signed
I have created an android application that calls (using kSOAP library) a SOAP based
Scenario I have made a phonegap 1.0.0 app which loads the current location via

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.