Code has been added to clipboard!

Creating PHP RSS Parser

      function show_rss(str) {
        if (str.length == 0) { 
          document.getElementById("rss_output").innerHTML = '';
        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;
        }'GET', 'get_rss.php?q=' + str, true);

      <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>
    <div id="rss_output">This is where the RSS feed data goes.</div>