title: How to get attribute of a node with a namespace in javascript?
body: <p>I'm trying to parse Reddit's <a href="http://www.reddit.com/new/.xml" rel="nofollow">XML file</a> with javascript and im having trouble retrieving an attribute from a node with a namespace. I want to get the following URL</p>
  
  <p><code>&lt;media:thumbnail url="http://f.thumbs.redditmedia.com/LdOsi1MnWuzGvbDq.jpg"/&gt;</code></p>
  
  <p>What I tried so far but none of these have worked:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  //...XMLHttpRequest...
             var items = data.getElementsByTagName("item");
  
              for (var i = 0; i &lt; items.length; i++) {
                  var item = items[i];
  
                  //titleNode and title work fine
                  var titleNode = item.getElementsByTagName("title")[0];
                  var title = titleNode.firstChild.data;
  
                  //the following don't work, they actually cause the google chrome extension to stop working :(
  
                  //attempt 1
                  thumbnail = item.getElementsByTagName('thumbnail')[0];
  
                  //attempt 2
                  thumbnail = item.getElementsByTagName('media:thumbnail')[0];
  
                  //attempt 3    
                  thumbnail = item.getElementsByTagName('media', 'thumbnail')[0];
  
                  //attempt 4
                  thumbnail = item.getElementsByTagNameNS('http://search.yahoo.com/mrss/', 'thumbnail')[0];
  
                  //attempt 5
                  thumbnail = item.getElementsByTagNameNS('http://search.yahoo.com/mrss/', 'thumbnail')[0].getAttriubte("url");
  
                  //attempt 6
                  thumbnail = item.getElementsByTagNameNS('http://search.yahoo.com/mrss/', 'thumbnail')[0].firstChild.data;
  
                  document.write(thumbnail);
              }
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm lost can you offer any help?</p>