title: Ajax call work perfectly in Firefox, Chrome & IE9+ and but does not work in IE8 or IE7-Javascript
body: <p>I have the ajax call with <a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest" rel="nofollow">XMLHttpRequest</a> which works perfectly in Firefox, Chrome &amp; IE9+ and  but does not work in IE8 or IE7. </p>
  
  <p>I am using <a href="http://api.prototypejs.org/" rel="nofollow">Prototypejs</a> I have tried with <a href="http://api.prototypejs.org/ajax/Ajax/Request/" rel="nofollow">Ajax.Request</a> but getting same issue. </p>
  
  <p>Can anyone tell me what's wrong with the following? Do I have to use <a href="https://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx" rel="nofollow">XDomainRequest object</a> for this. </p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>            var grt = $F('Type1');
              var serviceUrl = serviceURI.restfulURL;
              serviceUrl = serviceUrl
                      var xmlhttp = new XMLHttpRequest();
                      xmlhttp.open("GET", serviceUrl, true);
                      xmlhttp.send();
  
                      xmlhttp.onreadystatechange = function() {
                          if (xmlhttp.readyState == XMLHttpRequest.DONE ) {
                             if (xmlhttp.status == 200) {
                             var responseData=xmlhttp.responseText;
                             if (responseData == null
                                      || responseData == "") {
                                  var ele = document
                                          .getElementById('table1');
                                  ele.innerHTML = "";
                                  var tr = document.createElement('tr');
                                  ele.appendChild(tr);
                                  var td = document.createElement('td');
                                  tr.appendChild(td);
                                  var txt = document
                                          .createTextNode(data1);
                                  td.appendChild(txt);
                              } else {
                                  var ele = document
                                          .getElementById('table1');
                                  ele.innerHTML = "";
                                  var jsonString = JSON
                                          .parse(responseData);
  
  
                                      var tr = document
                                              .createElement('tr');
                                      else.appendChild(tr);
                                      var td = document
                                              .createElement('td');
                                      tr.appendChild(td);
                                      var txt = document
                                              .createTextNode(data2);
                                      td.appendChild(txt);
                                  }
                              }
                          }
  
                      }
  
              return false;
  </code></pre>