title: ajax/javascript syntax
body: <p>I've narrowed down the possible errors to be within an if statement.  I'm trying to make two images appear within divs if my php file returns true after authenticating a user.  There error comes when I try to add the image to the divs "b1" and "b2" with "innerHTML."</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;
     &lt;title&gt; Incident Center &lt;/title&gt;
     &lt;!--&lt;link rel="stylesheet" href="http://web.njit.edu/~swp5/assignment/style/style.css"&gt;--&gt;
     &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
     &lt;script type="text/javascript"&gt;
  function ajaxFunction(){
      var ajaxRequest;  
  
      if (window.XMLHttpRequest)
      {
      ajaxRequest=new XMLHttpRequest();
      }
      else
      {
      ajaxRequest=new ActiveXObject("Microsoft.XMLHTTP");
      }
  
      ajaxRequest.onreadystatechange = function(){
          if(ajaxRequest.readyState == 4){
              if(ajaxRequest.responseText=="true")
              {
              //ERROR HERE
              document.getElementById('b1').innerHTML ="&lt;img src="http://web.njit.edu/~swp5/assignment2/view.png" width=50 height=50&gt;";
              document.getElementById('b2').innerHTML ="&lt;img src="http://web.njit.edu/~swp5/assignment2/view.png" width=50 height=50&gt;";
  
              }
  
              else
              {
              document.getElementById('n1').innerHTML = "&lt;h4&gt;IT WAS FALSE&lt;/h4&gt;";
              }
          }
      }
      var un = document.getElementById('un').value;
      var pw = document.getElementById('pw').value;
      var queryString = "?un=" + un + "&amp;pw=" + pw;
      ajaxRequest.open("GET", "auth.php" + queryString, true);
      ajaxRequest.send(null); 
  }
  
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  
  &lt;div class="header"&gt;
  Incident Center 
  
  &lt;/div&gt;
  
  
  
  &lt;p&gt;
  
  
  &lt;div class="t1"&gt;
  &lt;form name='myForm'&gt;
  username: &lt;input type='text' id='un'&gt; &lt;br&gt;
  password: &lt;input type='password' id='pw'&gt; &lt;br&gt;
  
  &lt;input type='button' onclick='ajaxFunction()' value='Enter' /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  
  
  
  &lt;/p&gt;
  
  
  &lt;p&gt;
  
  &lt;div id="n1"&gt;
  &lt;div id="b1"&gt;&lt;/div&gt;
  &lt;div id="b2"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/p&gt;
  
  &lt;/body&gt;
  
  
  
  &lt;/html&gt;
  </code></pre>