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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:14:08+00:00 2026-06-04T10:14:08+00:00

I have got below Jquery JSONP two calls, it is for crossdomain calls, now

  • 0

I have got below Jquery JSONP two calls, it is for crossdomain calls, now when page is loading it fires these two calls and the problem is now the calls are very fast and before the fast is completed and it fires the second call and this is giving parser error for second call (airxml: is not a function).

Now below code works fine if we have got async: false, in the call, but as per the crossdomain policy it does not support the synchronous calls.

var oXMLHTTP, i, length, oData, sValue, sDisplay, sName, sMatch, oRegExp;
     var qr = "&jsonpcall=true";
   if (!oDropdown)
        return;

    oXMLHTTP = this.createXMLHttpRequest();
    this.FilterUrl = sFilterUrl;
    if (sFilterUrl != previousFilterUrl)
    {

        var regUrl = sFilterUrl;               
        var regquest = $.ajax({
            url: regUrl+qr,  
            type: "GET",
            async: false,   
            cache: true,                            
            contentType: "application/json; charset=utf-8",
            dataType: "jsonp",
            jsonpCallback: "airport",                 
            success: function(data, textStatus, jqXHR) 
            {                
                if (data.result[0] != '')
                {
                        sFilterData = data.result[0];                   
                }          
            }
            }); 
        previousFilterUrl = sFilterUrl;
    }

    if(!fireRequestOnce ||(fireRequestOnce && retrievedData == null))
    {       
         var regUrl = sXML;  
         var airquest = $.ajax({
            url: regUrl+qr, 
            async: false,                 
            dataType: 'jsonp',
            jsonpCallback: 'airxml',            
            cache: true,
            success: function(data, textStatus, jqXHR) 
            {
                    var xmlDoc = $.parseXML(data.myresult);
                oData = xmlDoc.documentElement.childNodes;
            }
        });
    }

Please suggest what can be the best approach, I have tried putting variable after the success event fires and then was trying to call second call, but it didn’t worked.

  • 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-04T10:14:09+00:00Added an answer on June 4, 2026 at 10:14 am

    When you need sequential AJAX call, try to avoid the async:false or jQuery.ajaxSetup({async:false}); What these option does is , it will lock the browser until the AJAX call completes. In this type of situation I prefer ajaxQueue plugin by gnarf.

    What this plugin will do is, it will en-queue all incoming AJAX requests, and process one after another. It is pretty simple to use as shown here.

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

Sidebar

Related Questions

I have two pages - a simple HTML code example page from a jQuery
I am using JQuery and I have got below JQuery Code sample. JQuery Code:
I am trying to use javascript/jquery. I have got below HTML where I want
I am using JQuery. I have got one link as given below: <li><a href=http://staging/english/Skywards/skywards.aspx
I am using HTML and Jquery I have got below issue, I have an
I have got below JQuery where I am performing the .load function. $(.load-fragment).each(function() {
I am using Jquery. I have got below links in my html <a class=load-fragment
I am trying to use Jquery to resolve my below issue. I have got
I am using HTML and JQuery. I have got below HTML for the dropdown.
I have got the below stored procedure to return the list of Id, parentId

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.