Code has been added to clipboard!

Creating PHP RSS Parser

Example
<html>
  <head>
    <script>
      function show_rss(str) {
        if (str.length == 0) { 
          document.getElementById("rss_output").innerHTML = '';
          return;
        }
        if (window.XMLHttpRequest) {
            //if the field is not empty, create an XMLHttpRequest to get suggestions
            xmlhttpreq = new XMLHttpRequest();
          } else {
            // server response is ready, we call the function
            xmlhttpreq = new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttpreq.onreadystatechange = function() {
          if (this.readyState==4 && this.status==200) {
            document.getElementById('rss_output').innerHTML = this.responseText;
          }
        }
        xmlhttpreq.open('GET', 'get_rss.php?q=' + str, true);
        xmlhttpreq.send();
      }
    </script>
  </head>
  <body>

    <form>
      <select onchange="show_rss(this.value)">
        <option value="">Select the RSS feed title:</option>
        <option value="google_news">Google News</option>
        <option value="bbc_news">BBC News</option>
      </select>
    </form>
    <br>
    <div id="rss_output">This is where the RSS feed data goes.</div>
  </body>
</html>