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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:00:07+00:00 2026-06-12T20:00:07+00:00

Developers! I’m having some trouble understanding the rss feed enclosure tag.. Here you got

  • 0

Developers!

I’m having some trouble understanding the rss feed enclosure tag..
Here you got the relevant code:

$(document).ready(function(){


    $('#btnHentRss').click(function(){
        fyllNyheter();
    });

});

    function fyllNyheter(){

        var url = $('#feedListe').val();

            $.getFeed({
                url: "getRSS.php?url=" + url,
                success: function(feed){
                     parseXML(feed);
            },
            error: function(){
                $('#sectId').html("<p>Something went wrong</p>");
            },
            complete: function(){

            }
        });

}
 function parseXML(feed){

       $.each(feed.items, function(i, item){
                var tittel = item.title;
                var beskrivelse = item.description;
                var url= $(item).find("enclosure['url']");

                $('#sectId').append("<img src='" + media + "' />");
            }); 
}

Example of the xml:

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
<channel>
<title>NRK - Musikknyheter</title>
<link>http://nrk.no/liste.rss</link>
<description>Musikknyheter</description>
<pubDate>Sat, 13 Oct 2012 16:20:47 +0200</pubDate>
<sy:updateFrequency>12</sy:updateFrequency>
<sy:updatePeriod>hourly</sy:updatePeriod>
<item>
<title>Ny slagkraftig festspillprodusent</title>
<link>http://www.nrk.no/nyheter/distrikt/troms_og_finnmark/1.8354920</link>
<description>Festspillene i Nord-Norge har ansatt Nasra Ali Omar som ny produsent for barn og unge.</description>
<pubDate>Thu, 11 Oct 2012 14:41:39 +0200</pubDate>
<enclosure url="http://www.nrk.no/contentfile/imagecrop/1.6102705?cropid=f169w225" type="image/jpeg"/>
</item>
</channel>
</rss>

var tittel returns the correct title of each item(So I know I got contact with the feed).

var url only returns [Object object].

I’m using jFeed. See the jFeed php and js here: http://jsfiddle.net/zbuNW/

What am I supposed to do? My google searches has turned purple, I don’t want to use another plugin, and I want to do it in javascript/jquery.

Thanks for even reading my problem 🙂 Happy problem solving!

  • 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-12T20:00:08+00:00Added an answer on June 12, 2026 at 8:00 pm

    REVISED Answer after xml was posted:

    url is an attribute of the enclosure tag

    Use:

    var url =  $(item).find("enclosure").attr('url')
    

    Demo: http://jsfiddle.net/AV4ms/

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

Sidebar

Related Questions

why are some developers using JQuery's .find-function like this: $(document).find('.progress').show(); If you know the
Ok developers needing some help here. I am working on a MVC 3 project
Some developers uses curly braces in their PHP code and some simply concatenates them.
Some developers are particular about how they format their codes, for some good reasons.
I read http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html but have some issues. For pre-honeycomb I want a custom title,
My developers and I are having an issue with objects being garbage collected in
Hello developers, again here with new problem !! In my thread program I was
Several developers need to use InstallShield to build and test their code, but we
Different developers use differnt IDE in my team. One Intellij Idea user wrote code
Previous developers used source code from this website to create a URL shortener. 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.