title: Issue with window.XMLHttpRequest in Internet Explorer (works in Chrome)
body: <p>I have what should be a simple script, as follows:</p>
  
  <pre><code>function functionName(code){
  var xmlhttp;
  if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
  else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
  xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4)
          {
          var result=xmlhttp.responseText;
          if (result=="FAIL")
          {
              // Alert 
          }
          else
          {
              // Alert
          }
          }
  }
  xmlhttp.open("GET","script.php?q="+code,true);
  xmlhttp.send();
  }
  </code></pre>
  
  <p>I have a button on the page with an onclick command that calls the function:</p>
  
  <pre><code>&lt;form action=""&gt;
  &lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;input type="text" name="code" id="code" size="4"&gt;&lt;/td&gt;&lt;td&gt;&lt;a onclick="functionName(code.value)"&gt;&lt;img src="images/button.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
  </code></pre>
  
  <p></p>
  
  <p>sending it a code from a form input that gives one response if the script.php returns "FAIL" and another alert in all other situations (it does more than this, but took out everything else and used alerts for troubleshooting). The code runs fine within Chrome, but not within Internet Explorer. I am quite new to this so am not sure how to go about debugging it, is there anything obvious that would be causing the problem between the browsers? Thanks for any help.</p>
  
  <p>EDIT:</p>
  
  <p>I have narrowed it down to it actually being the onclick that is causing the problem so am going to research why this is not working in IE...</p>
  
  <p>EDIT 2:</p>
  
  <p>Turns out it looks like an IE10 quirk - works in all other versions, and in compatibility view, no ideas why though</p>