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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:21:29+00:00 2026-06-04T07:21:29+00:00

I’m attempting to pull two separate things from outside sources to put onto an

  • 0

I’m attempting to pull two separate things from outside sources to put onto an HTML page I’m creating. I have a successful AJAX function to pull the most recent video from a particular Youtube channel by parsing through the XML/RSS feed for that channel. I receive this feed through an AJAX call.

I’d also like to get the most recent blog post from a Blogger account. The code for parsing the feed to get the most recent entry shouldn’t be difficult, but I’m having trouble with simultaneous AJAX calls. I read somewhere that it can only handle one at a time? I’m weary about queuing them because I don’t want to the content on the page to load in steps. I’d rather it all just get fetched simultaneously. How might I go about doing this?

Here is my current script:

<script type="text/javascript" charset="utf-8">
    $(function() {
      $.ajax({
        type: "GET",
        url: "http://gdata.youtube.com/feeds/base/users/devinsupertramp/uploads?orderby=updated&alt=rss&client=ytapi-youtube-rss-redirect&v=2",
        dataType: "xml",
        success: parseXml
      });
    });

    function parseXml(xml) {
        $(xml).find("item:first").each(
            function() {
                var tmp = $(this).find("link:first").text();
                tmp = tmp.replace("http://www.youtube.com/watch?v=", "");
                tmp = tmp.replace("&feature=youtube_gdata", "");
                var tmp2 = "http://www.youtube.com/embed/" + tmp + "?autoplay=1&controls=0&rel=0&showinfo=0&autohide=1";
                var iframe = $("#ytplayer");
                $(iframe).attr('src', tmp2);
            }
        );
    }
</script>
  • 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-04T07:21:30+00:00Added an answer on June 4, 2026 at 7:21 am

    I read somewhere that it can only handle one at a time?

    Either you misunderstood what the person was trying to say or they were incorrect. Javascript doesn’t run any functions concurrently so someone with poor English might reword that as “can only handle one at a time” but that doesn’t mean you can’t make multiple AJAX calls. jQuery is smart and will do what it needs to do to make sure both calls are executed eventually.

    If you’d like all the content to be loaded simultaneously the sad fact is you can’t. However you can make it appear that way to the user by declaring a flag that is set by the success method of each call. Then just keep the content hidden until both flags have been set.

    EDIT:

    Here’s a very simplistic approach to make it appear that they are fetched simultaneously:

    <script type="text/javascript" charset="utf-8">
        var youtubComplete = false;
        var otherComplete = false;
    
        $(function() {
          $.ajax({
            type: "GET",
            url: "http://gdata.youtube.com/feeds/base/users/devinsupertramp/uploads?orderby=updated&alt=rss&client=ytapi-youtube-rss-redirect&v=2",
            dataType: "xml",
            success: parseXml
          });
          $.ajax({
            type: "GET",
            url: "http://someotherdata.com/",
            dataType: "xml",
            success: function() { otherComplete = true; checkFinished(); }
          });
        });
    
        function parseXml(xml) {
            $(xml).find("item:first").each(
                function() {
                    var tmp = $(this).find("link:first").text();
                    tmp = tmp.replace("http://www.youtube.com/watch?v=", "");
                    tmp = tmp.replace("&feature=youtube_gdata", "");
                    var tmp2 = "http://www.youtube.com/embed/" + tmp + "?autoplay=1&controls=0&rel=0&showinfo=0&autohide=1";
                    var iframe = $("#ytplayer");
                    $(iframe).attr('src', tmp2);
                }
            );
            youtubeComplete = true;
            checkFinished();
        }
        function checkFinished()
        {
            if(!youtubeComplete || !otherComplete) return;
            // ... Unhide your content.
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.