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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:52:00+00:00 2026-06-10T08:52:00+00:00

As the title suggests I would like to be able to use data from

  • 0

As the title suggests I would like to be able to use data from a XML file in a HTML page. Let me explain what the page is trying to do in order to help explain what I need help with..

The HTML page when complete will go to the YouTube servers with a search query and retrieve a XML file that is generated from the search with up to date information.
Then the page will look into the XML file given, and find the <yt:videoid> node, and transfer the string to the HTML file.
Then the HTML file can use the string (probably in javascript) to make the embed video code.

The resulting page will therefore always have the latest video due to the search query.

So far I have found the link to get the XML file (below) and had a look at the XML
(Link: https://gdata.youtube.com/feeds/api/videos?author=inthegamesroom&orderby=published&prettyprint=true&start-index=1&max-results=1&v=2)

I found out that the information I want is in a node called <yt:videoid> which is under <media:group> which is under <feed>

After doing some research online (as I am not a javascript programmer, I only have a basic knowledge, I found that you can use XML DOM to read and adapt XML files from within an HTML page. But the problem with XML DOM code is that it requires the XML file to be hosted on the actual server itself, which it is obviously not – as it’s on youtube.

Does anyone know a way I could just read the data and put it into a javascript variable? I don’t necessarily want you to spend ages writing some code, but at least hope you can lead me in the right direction?

Thanks a lot in advanced,

Ant.

PS, Please bear in mind I am not a JS or HTML programmer.. I only know the basics, and if I have done anything wrong in this post please let me know as this is a first for me on stackoverflow.

  • 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-10T08:52:01+00:00Added an answer on June 10, 2026 at 8:52 am

    There is no need to do anything browser side to get the XML or parse it.

    Youtube’s API is public and allows anyone (?) to query it, meaning you just need a simple ajax call to get the xml file. With some additional jQuery (or any other library) you can then extract the id of the video:

    jQuery(document).ready(function() {
        // request xml data
        jQuery.ajax('https://gdata.youtube.com/feeds/api/videos?author=inthegamesroom&orderby=published&prettyprint=true&start-index=1&max-results=1&v=2',{
            dataType:'xml',
            success: function(data,status, xhr ) {
               // process response
               var $_d =$(data);
    
               var videoTag = $_d.find('yt\\:videoid'); // doesn't seem to work
               var videoTag = $_d.find('videoid'); // works
               var videoId = videoTag.text();
    
               // do the embedding
               embedYT(videoId);
            }
        });
    
       // a simple way to embed a youtube player in a page
       function embedYT(id) {
            jQuery(document.body).append("<iframe class='youtube-player' type='text/html' width='640' height='385' src='http://www.youtube.com/embed/"+id+" frameborder='0'></iframe>")
       }
    });
    

    jsFiddle

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

Sidebar

Related Questions

As what the title suggests, I would like to be able to lock all
As the title suggests I would like to convert a long number to the
As the title suggests, I would like to get the last word out of
As the title suggests I would like to understand why static classes can have
As the title suggests, I would like to see if this is something people
I have html. <p class=textlimity title=heyheyhey> asd</p> now in js i would like to
As the title suggests, I would like to close a Visual Studio tool window
As the title suggests, I would like to know if it is possible to
As the title suggest, I would like to do the above. Example below: library(stringr)
As the title suggests is it possible to execute another java app from within

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.