title: AJAX call not working in Edge and IE, it works only in Firefox and Chrome
body: <p>I tried to call Java REST API through AJAX. It works only on Firefox and Chrome browsers but it doesn't work in Microsoft Edge and IE. It shows error like:</p>
  
  <blockquote>
    <p>"SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete
    the operation due to error 00002efd."  and "SCRIPT7002:
    XMLHttpRequest: Network Error 0x80070005, Access is denied.".</p>
  </blockquote>
  
  <p>My AJAX call is:</p>
  
  <p>First one:</p>
  
  <pre><code>$(function getTest() {
    var url = 'http://localhost:8080/MyService/user/getListOfGender?_=1487141734780';
    var xhr = new XMLHttpRequest();
    xhr.open('GET', url, true);
    xhr.onload = function(e) {
      var arraybuffer = JSON.parse(xhr.responseText);
      console.log(arraybuffer.Result);
    };
    xhr.send();
  });
  </code></pre>
  
  <p>Second method:</p>
  
  <pre><code>$(function getGenderId() {
    var sessionId = getSessionId();
    $.ajax({
      url: "http://localhost:8080/MyService/user/getListOfGender?_=1487141734780",
      type: 'GET',
      crossDomain: true,
      dataType: 'json',
      beforeSend: function(xhr) {
        xhr.setRequestHeader('sessionId', sessionId);
        xhr.setRequestHeader('Accept',
          'text/html, application/xhtml+xml, image/jxr, */*');
      },
      success: function(data) {
        var sData = data.Result;
        var genderData = JSON.parse(sData);
        for (var i = 0; i &lt; genderData.length; i++) {
          var genderId = genderData[i].genderId;
          var genderName = genderData[i].gender;
          $("#gender").append(
            '&lt;option id="' + genderId + '"&gt;' + genderName +
            '&lt;/option&gt;');
        }
      },
      error: function(e) {
        // alert("Error" + e);
        if (e.status == "401") {
          $("#sessionModal").modal();
        }
      },
      cache: false,
      contentType: false,
      processData: false
    });
  });
  </code></pre>
  
  <p>and my rest api service </p>
  
  <pre><code>@Path("/getListOfGender")
  @GET
  @Produces(MediaType.APPLICATION_JSON)
  public String getListOfGender() {
      String response = dataFetchService.getListOfGender();
      return response;
  }
  </code></pre>
  
  <p>and my server cors configuration</p>
  
  <pre><code>&lt;filter&gt;
      &lt;filter-name&gt;CORS&lt;/filter-name&gt;
      &lt;filter-class&gt;com.thetransactioncompany.cors.CORSFilter&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.allowGenericHttpRequests&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.allowOrigin&lt;/param-name&gt;
          &lt;param-value&gt;*&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.allowSubdomains&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.supportedMethods&lt;/param-name&gt;
          &lt;param-value&gt;GET, HEAD, POST, OPTIONS&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.supportedHeaders&lt;/param-name&gt;
          &lt;param-value&gt;origin, accept,Content-Type, X-Requested-With, sessionId&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.exposedHeaders&lt;/param-name&gt;
          &lt;param-value&gt;X-Test-1, X-Test-2&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.supportsCredentials&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;cors.maxAge&lt;/param-name&gt;
          &lt;param-value&gt;-1&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;CORS&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>I tried to call the server from IE and Edge but it doesn't work. Let my know whether need to change from client or server side, if anything required. Thanks in advance.</p>