title: Problem parsing Rss feed using javascript
body: <p>I am trying to read <strong>two Rss feed urls</strong> at regular intervals and display the latest feed title as a notification inside my android app.</p>
  
  <p>As the setinterval function is being called every 8000 ms I want to make sure there are no duplicate notifications of the same title. </p>
  
  <p>When I do a console.log inside the getrss function I am able to see the xml object, but
  I am not able to see any data being outputted for <strong>var xml , var entry or var title</strong> .
  Plese point out were I might be going on.</p>
  
  <pre><code>/* ---------------------- global variables ---------------------- */
  
      var Rss1_title;
      var Rss2_title;
  
  /* ---------------------- end global variables------------------- */
  
  /* --------- pull latest Rss feed title for first url: ---------- */  
  
      function update_rss1_feeds(){
      var new_title = getRss("http://yofreesamples.com/category/real-freebies/feed/");
          if(Rss1_title != new_title)
  
  //display the notification
  
              navigator.notification.alert(
                  new_title,  // message
                  'New Rss Entry',                 // title
                  'New Rss Entry'                  // buttonName
              );
  
          Rss1_title = new_title;             
      }
  /* --------- end : --------- */
  
  /* --------- pull latest Rss feed title for second url: --------- */  
  
      function update_rss2_feeds(){
      var new_title = getRss("http://yofreesamples.com/category/free-coupons/feed/");
          if(Rss2_title != new_title)
  
  //display the notification
  
              navigator.notification.alert(
                  new_title,  // message
                  'New Rss Entry',                 // title
                  'New Rss Entry'                  // buttonName
              );
  
          Rss2_title = new_title;             
      }
  /* --------- end : --------- */
  </code></pre>
  
  <p>This is the getrss function were I parse the Rss feed. I might be doing something wrong over here.</p>
  
  <pre><code>function getRss(url){
  if(url == null) return false;
  
              // Create Google Feed API address
              var api = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;q=" + encodeURIComponent(url);
              api += "&amp;output=json_xml"
  
              var newEntry;
              // Send request
              $.getJSON(api, function(data){
                  console.log('testdata',data); // the response is xmlobjest
                  // Check for error
                  if (data.responseStatus == 200) {
  
                      var feeds = data.responseData.feed;
                      if (!feeds) {
                          return false;
                      }
  
                      // Get XML data for media (parseXML not used as requires 1.5+)
                      var xml = getXMLDocument(data.xmlString);
                      var xmlEntries = xml.getElementsByTagName('item');
                      var entry = feeds.entries[0];
                      var title = entry.title;
                      console.log('test',title); // it is not being displayed , it seems its not going inside the if statement
                      return title;
                  }else {
  
                  };              
  
              });             
  
  }
  </code></pre>
  
  <p>This is the Function call.</p>
  
  <pre><code>setInterval('update_rss1_feeds()',7000);
  setInterval('update_rss2_feeds()',8000);
  </code></pre>