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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:34:29+00:00 2026-05-13T01:34:29+00:00

I guess this question isn’t only specific to YUI, but that’s the JS library

  • 0

I guess this question isn’t only specific to YUI, but that’s the JS library I’m using and a specific answer would be helpful.

Basically when loading a page, I want a script to run a few XHRs using Y.io, and if they all return the data successfully then I want the script to move on to the next step, which will manipulate the data received.

I can think of a few ways of doing this, but they all seem a bit clumsy to me and I hope someone has a better suggestion. My ideas so far:

  1. Consolidate all the data I want into one JSON response, so if that one request is good, move on. (This is the solution I like least).
  2. When the first Y.io request returns successful, call the next, and so on, and when the last is successful then I know everything succeeded and move on to the next step of the script.

Any better ideas out there? I’m not really liking either of mine at the moment, but I’m leaning towards option two.

  • 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-05-13T01:34:29+00:00Added an answer on May 13, 2026 at 1:34 am

    You shouldn’t need to queue the Y.io calls. Just send them all at once and when they all return, move on.

    var data = {};
    
    function step(id, o, part) {
        try {
            data[part] = Y.Lang.JSON.parse(o.responseText);
    
            if (data.a && data.b && data.c) {
                processData(data);
            }
        }
        catch (e) {
            /* handle bad JSON, failure case */
        }
    }
    
    Y.io(a_url, { on: { success: step }, 'arguments': 'a' });
    Y.io(b_url, { on: { success: step }, 'arguments': 'b' });
    Y.io(c_url, { on: { success: step }, 'arguments': 'c' });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I guess this isn't technically a code question, but it's something that I'm
My guess is that this question will fall under the category of duh, but,
I guess this is not a specific question, but getting ideas on how to.
Maybe the question isn't that clear, but with an example, I guess I'll clear
I guess this question will sound familiar, but I am yet another programmer baffled
I guess this is kind of an odd question but I have tried setting
This question is about Unity Container but I guess it is applicable to any
I'm working in AS3, but I guess this could be a general question, so
This is a question which isn't linked to any practical situation I'm in, but
I guess my question is very simple, but anyway... I've created neural network using

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.