title: Uncaught TypeError: Cannot set property 'innerHTML' of null
body: <p>I have been having some trouble with this code. I have tried my best to stay with the book but the book seems to be wrong.</p>
  
  <p>The following code should display the RSS feed for which ever radio button has been selected. You can also see the website on <a href="http://w3.cnm.edu/~bnoble/cis1210/afds/Travel/TravelDeals.html" rel="nofollow">http://w3.cnm.edu/~bnoble/cis1210/afds/Travel/TravelDeals.html</a>.</p>
  
  <p>Thanks in advance for any help!</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Travel Deals RSS Feed&lt;/title&gt;
      &lt;script&gt;
          var rssRequest = false;
          function getRequestObject()
          {
              try
              {
                  rssRequest = new XMLHttpRequest();
              }
              catch (requestError)
              {
                  try
                  {
                  rssRequest = new ActiveXObject();
                  }
                  catch (requestError)
                  {
                      try
                      {
                          rssRequest = new 
                          ActiveXObject("Micorsoft.XMLHTTP");
                      }
                      catch (requestError)
                      {
                          window.alert("I am sorry. Your browser does not support AJAX. Please upgrade your broweser and try again.");
                          return false;
                      }
                  }
              }
              return rssRequest;
          }
          function rssUpdate()
          {
              if(!rssRequest)rssRequest = getRequestObject();
              for (var i=0; i&lt;6; ++i)
              {
                  if (document.forms[0].deals[i].checked == true)
                  {
                      var rss = document.forms[0].deals[i].value;
                      break;
                  }
              }
              rssRequest.abort();
              rssRequest.open("get","TravelDeals.php?" + "rss" + rss, true);
              rssRequest.send(null)
              rssRequest.onreadystatechange=getRssDeals;
              //clearTimeout(recentDeals);
              //var recentDeals = setTimeout('rssUpdate()', 5000);
          }
          function getRssDeals()
          {
              if(rssRequest.readyState==4 &amp;&amp; rssRequest.status == 200)
              {
                  var deals = rssRequest.responseXML; 
                  document.getElementById("rssFeed").innerHTML = ""
                  var dealsInfo=deals.getElementsByTagName("item");
                  if (dealsInfo.length &gt; 0)
                  {
                      for (var i=0; i&lt;dealsInfo.length; ++i) 
                      {
                          var curHeadline = dealsInfo[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
                          var curlink = dealsInfo[i].getElementsByTagName("link")[0].childNodes[0].nodeValue;
                          var curPubDate = dealsInfo[i].getElementsByTagName("pubDate")[0].childNodes[0].nodeValue;
                          var curDesc = dealsInfo[i].getElementsByTagName("description")[0].childNodes[0].nodeValue;
                          var curDeal = "&lt;a href='" + curLink + "'&gt;" + curHeadline + "&lt;/a&gt;&lt;br/&gt;";
                          curDeal +=  curDesc + "&lt;br/&gt;";curDeal += curDesc + "&lt;br/&gt;";
                          document.getElementById("rssFeed").innerHTML += curDeal;
                      }
                  }
                  else
                      document.getElementById("rssFeed").innerHTML = "The RSS feed appears to be broken or empty.";
              }
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="rssUpdate()"&gt;
      &lt;h1&gt;Travel Deals RSS&lt;/h1&gt;
      &lt;form method="get" action=""&gt;
          &lt;table border="1"&gt;
              &lt;colgroup span="1" width="125"/&gt;
              &lt;colgroup span="1" width="350"/&gt;
              &lt;tr&gt;
                  &lt;td align="top"&gt;
                      &lt;input type="radio" name="deals" value="http://www.orbitz.com/rss/topdeals-vacationpackages.rss.xml" onclick="rssUpdate()"/&gt;&lt;Orbitz&lt;br/&gt;
                      &lt;input type="radio" name="deals" value="http://www.travelocity.com/dealservice/globaltrips-shopping-svcs/deals-1.0/services/RssDealsServices?ProductType=Air&amp;rdr=GEN&amp;nm=My~Travelocity~Specials&amp;typ=0&amp;orig=ABQ&amp;dest=PHX,LAS,LAX,NYC,LGB&amp;id=9197I1366355523195" checked="checked" onclick="rssUpdate()"/&gt;&lt;Travelocity&lt;br/&gt;
                      &lt;input type="radio" name="deals" value="http://press.hotwire.com/index.php?s=43&amp;pagetemplate=rss" onclick="rssUpdate()"/&gt;&lt;Hotwire&lt;br/&gt;
                  &lt;/td&gt;
                  &lt;td id="rssFeed" valign="top&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>