jquery - Parse external XML (rss) with javascript? -


i want parse rss without php:

<rss version="2.0">   <channel>     <item>        <title>test</title>        <link>http://www.test.com</link>        <image>           <url>http://foo.bar/test.jpg</url>        </image>        <description>        <![cdata[description text here!<br><a href="http://www.test.se" target="_blank" rel="external" data-ajax="false">link!</a></div>]]>        </description>     </item>   </channel> </rss> 

can accomplish without php? i'm complete newbie in jquery/javascript.. the xml here: http://hundkartan.se/karta/kartdata/cron_webbutiker_mob.xml

i'm going use in phonegap it's external feed.

my advice use json javascript. can convert xml json file external script (like xml2json).

json natively supported javascript access member simple. example obtain link can do:

<head>     <script type="text/javascript" src="xml2json.js"></script>     ... </head> ...  <body>      <script>     var json = xml2json.parser(xml_file);     var channel = json.rss.channel;     var links = [];     for(var = 0; < channel.item.length; i++)         links.push(channel.item[i].link);     ...     </script>     ... </body> 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -