parse rss feed using javascript
<p>I am parsing an RSS feed using PHP and JavaScript. First I created a proxy with PHP to obtain the RSS feed. Then get individual data from this RSS feed using JavaScript. My issue with with the JavaScript. I am able to get the entire JavaScript document if I use <code>console.log(rssData);</code> with no errors. If I try to get individual elements within this document say for example: <code>&lt;title&gt;</code>, <code>&lt;description&gt;</code>, or <code>&lt;pubDate&gt;</code> using <code>rssData.getElementsByName("title");</code> it gives an error "Uncaught TypeError: Object....has no method 'getElementsByName'". So my question is how to I obtain the elements in the RSS feed?</p>

<p><strong>Javascript (Updated)</strong></p>

<pre><code>function httpGet(theUrl) {
    var xmlHttp = null;

    xmlHttp = new XMLHttpRequest();
    xmlHttp.open("GET", theUrl, false);
    xmlHttp.send(null);
    return xmlHttp.responseXML;
}

// rss source
var rssData = httpGet('http://website.com/rss.php');

// rss values
var allTitles = rssData.getElementsByTagName("title");    // title
var allDate = rssData.getElementsByTagName("pubDate");    // date
</code></pre>
