title: I have a problem with the Fetch API using Internet Explorer 11
body: <p>I have some Problem with this code. I will use this code instead of a polyfill. The code works using Firefox, Chrome, Opera and MS Edge but the Internet Explorer 11 is not responding. Can someone give me a tip for Troubleshooting.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>function fetchFile(file,method,params,target) {
  
  const controller = new AbortController();
  const signal = controller.signal;
  
  setTimeout(controller.abort.bind(controller), 5000); 
  
  var options = { method: method, signal }; 
  
  if (params != 'default') {
  
  switch (method) { case 'GET':  file = file+'?'+params; break;
  
                    case 'POST': var data = params; break; default: data = 'data'; break;}
  
  } 
  
  switch (method) { case 'POST': options.body = data; options.headers = {"Content-Type": "application/x-www-form-urlencoded"}; break;}
  
  fetch(file, options).then(function (response)  {
  
    return response.text();
  
  }).then(function (data)  {
  
    document.getElementById(target).innerHTML = data;  
  
    switch (data) {case '': loadXhttp(file,method,params,target); break;} 
    
    
  }).catch(function (data) {
  
  
  switch (error.name) {
  
     case 'AbortError': var error = 'Abort Error'; break; 
  
     default: error = 'Other Error'; break;} 
  
     document.write(error);
  
  });
  
  }
  
  function loadXhttp(file,method,params,target) {
    var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      if (this.readyState == 4 &amp;&amp; this.status == 200) {
        document.getElementById(target).innerHTML = this.responseText;
      }
    };
    xhttp.open(method, file, true);
    
    switch (method) {case 'GET': var send = null; break;
                    case 'POST': xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                     send = params; break;} 
    
    xhttp.send(send);
  }
  ​</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thank You.</p>
  
  <p>Best Regards, Markus</p>