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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:46:03+00:00 2026-06-03T19:46:03+00:00

PHP returns value with 1-2 second delay jQuery.post doesn’t wait for response. How do

  • 0

PHP returns value with 1-2 second delay jQuery.post doesn’t wait for response.

How do you think, is it possible to fix that problem and wait for response?

    $.post( sSource, aoData, function (data) {    
        oCache.lastJson = jQuery.extend(true, {}, data);
        if ( oCache.iCacheLower != oCache.iDisplayStart )
        {
            data.aaData.splice( 0, oCache.iDisplayStart-oCache.iCacheLower );
        }
        data.aaData.splice( oCache.iDisplayLength, data.aaData.length );
         abc(oCache);
        fnCallback(data); 
    },"json" );

Note the same function with get works well

    $.getJSON( sSource, aoData, function (json) { 
        /* Callback processing */
        oCache.lastJson = jQuery.extend(true, {}, json);

        if ( oCache.iCacheLower != oCache.iDisplayStart )
        {
            json.aaData.splice( 0, oCache.iDisplayStart-oCache.iCacheLower );
        }
        json.aaData.splice( oCache.iDisplayLength, json.aaData.length );

        fnCallback(json)
    } );
  • 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-03T19:46:05+00:00Added an answer on June 3, 2026 at 7:46 pm

    $.post is asynchronous, you need to use $.ajax and set async to false, that way you will be able to wait for the response.
    You can read more about it here: http://api.jquery.com/jQuery.ajax/

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

Sidebar

Related Questions

In PHP, max() returns the highest value in an array or the greatest value
I have a PHP page that returns a piece of HTML to set the
I am making a jQuery Ajax form submit to a PHP page that I
PHP manual states that time() returns   the current UNIX timestamp   ᴀ  ­
I have to call a php function wich takes one second to response, in
Hello i am having trouble with passing a php return value to the innerHTML
I am using PHP and I return this value: $_SESSION['sessionNum'] and I get an
I've just started to practice with PHP built-in gettype() and its return value. This
How would I use PHP's preg_replace() to return only the value inside the <h1>
PHP returns Accept-Languages ($_SERVER['HTTP_ACCEPT_LANGUAGE']) in a format like en-US, en, de-AT. How can I

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.