title: Receiving a .xls file using Ajax jquery POST
body: <p>I'm attempting to return an Excel file through a Ajax <code>POST</code> to the server, the server generates the .xls file, however it doesn't pass through to the front end, i think it has something to do with how i'm handling the response.  </p>
  
  <p>It should kick off a file download of the Excel file.  Originally i had <code>dataType JSON</code>, but after searching through threads i figure it's something to do with the <code>dataType</code> format and the <code>.done</code> function, but cannot work out what it should be.</p>
  
  <pre><code>function requestFile(myJSON) {
      var urlrequest = "mywebappexport/excel";
      var link = $('#exportbtn');
      $.ajax({
          url: link.attr('href'),
          type: "POST",
          data: JSON.stringify(myJSON),
          cache: true,
          contentType: "application/json; charset=utf-8",
          complete: function (data) {
          var ifr = ($('&lt;iframe /&gt;').attr('src',     link.attr('href')).hide().appendTo(link))
          setTimeout(function () {ifr.remove();}, 5000);
      }
      })
  
  };
  </code></pre>
  
  <p>Updated code:  working on modern browsers but fails on IE8 - with the error 
  <code>Unexpected call to method or property access.</code>  In jQuery version 1.9.1.js.
  <code>this.appendChild( elem );</code></p>