title: Ajax: Change responseText font color based on result
body: <p>Programmers here have been extremely helpful in resolving issues for me in the past, so I thought I'd ask an Ajax question. It's probably a simple fix, but I'm new to Ajax.</p>
  
  <p>What I'd like to do is change the style of the responseText to red if the result is the pharase, "NOT FOUND".  Otherwise the text will be black.  Here is the script I'm using:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
    &lt;!-- 
    function newXMLHttpRequest() 
    {
       var xmlreq = false;
       if (window.XMLHttpRequest) 
       {
          xmlreq = new XMLHttpRequest();
       } 
          else if (window.ActiveXObject) 
       {
          try 
          {
             xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
          }
             catch (e2) 
             {
                alert("Error: Unable to create an XMLHttpRequest.");
             }
        }
          return xmlreq;
    }
    function getLocation(location) 
    {
       var getLocation= newXMLHttpRequest(); // sending request
       getLocation.open("GET", "/PP?PAGE=GETLOCATIONNAME&amp;ROUTINGNUM=" + location, false);
       getLocation.send(null); // getting location
       document.getElementById("location_div").innerHTML = getLocation.responseText;
    }
    //--&gt;
   &lt;/script&gt;
  </code></pre>
  
  <p>Here is the HTML:</p>
  
  <pre><code>...
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td class="ajax_msg"&gt;
           &lt;div id="location_div"&gt;&lt;div&gt;       
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  ...
  </code></pre>