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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:00:47+00:00 2026-06-16T17:00:47+00:00

This has me stumped. I have an array of urls (for data) which I

  • 0

This has me stumped. I have an array of urls (for data) which I need to pull into the page and process the results once all are loaded. I am attempting to use JQuerys Deffered functionality to ensure that all of the ajax calls have completed before I process the results. As soon as I introduced it (the when().done() functionality), my responseText magically disappeared.

My simplest example:

$.when([$.ajax("pathToData")]).done(
    function(results) {
        console.log(results[0]);               //object with a responseText attribute
        console.log(results[0].responseText);  //undefined !!!
    }
)

I suspect I am missing something simple, but the more I read the documentation the more this looks correct. I’m hoping someone else can spot the issue easily and point me in the right direction. Thanks in advance!

  • 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-16T17:00:48+00:00Added an answer on June 16, 2026 at 5:00 pm

    The weird behaviour you’re seeing is a limitation of the console, and actually nothing to do with your code.

    The resolution of the properties of the object are deferred until you expand the Object in the console. By that time the AJAX request has completed and responseText is available. However, the value of results[0].responseText is resolved immediately as undefined.

    If you did:

    $.when([$.ajax({
        url: '/echo/json/',
        type: 'POST',
        data: {json: '{"a":12}'}
    })]).done(function(results) {
        console.log(JSON.stringify(results[0])); //object with a responseText attribute
        console.log(results[0].responseText); //undefined !!!
    })​
    

    You’ll see:

    {"readyState": 1}
    undefined
    

    Instead.


    As to how to solve your problem; I’ve never known $.when() to accept arrays, nor does the documentation say it does. Because of this, when() seems to be executing the done() immediately, as the array is not a deferred (per the docs):

    If a single argument is passed to jQuery.when and it is not a Deferred, it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately.

    Instead pass your AJAX request(s) as separate parameters, as shown in the docs:

    $.when($.ajax('a'), $.ajax('b')).done(function (a, b) {
      // a & b = [ "success", statusText, jqXHR ]
    });
    

    As such:

    $.when($.ajax({
        url: '/echo/json/',
        type: 'POST',
        data: {json: '{"a":12}'}
    }), $.ajax({
        url: '/echo/json/',
        type: 'POST',
        data: {json: '{"b":12}'}
    })).done(function(a, b) {
        console.log(a[2].responseText);
        console.log(b[2].responseText);    
    })​;
    

    There you get:

    {"a": 12}
    {"b": 12} 
    

    … and an updated fiddle: http://jsfiddle.net/39mHw/2/

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

Sidebar

Related Questions

This one has me stumped - I have an element on my page with
This one has me stumped. I need to call an activity method from within
this is my first question. This has stumped me for 2 days. I have
I am really stumped on this one. I have a simple python wrapper which
This has stumped me for some time. My problem: I have 2 different tables..
I am a bit stumped on this. Basically I have two tables: Page: id
This one has stumped me. If you have two select tags (see this demo
This has me stumped. The follow code returns ,,,,,,: <script type=text/javascript> $(function() { $('#listB').sortable({
This one has me stumped. <div id=container> <div id=store></div> <div id=contact></div> </div> I'm looking
This one has me stumped. Here are the relative bits of code: public AgencyDetails(Guid

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.