title: Download Excel file using jquery ajax
body: <p>Hi i want to download XLX file using spring mvc ajax call.Below is my ajax call to server.</p>
  
  <pre><code> $.ajax({
      type : 'GET',
      url : 'downloadExcel',
      beforeSend : function() {
          startPreloader();
      },
       complete: function(){
           stopPreloader();
       },
      success : function(response){
          console.log(response);
              var blob = new Blob([response], { type: 'application/vnd.ms-excel' });
              var downloadUrl = URL.createObjectURL(blob);
              var a = document.createElement("a");
              a.href = downloadUrl;
              a.download = "downloadFile.xlsx";
              document.body.appendChild(a);
              a.click();
      }
  });
  </code></pre>
  
  <p>Here is my server code</p>
  
  <pre><code>@RequestMapping(value = "/downloadExcel", method = RequestMethod.GET)
      @ResponseBody
      public List&lt;LicenceType&gt; downloadExcel() {
          return licenceTypeService.findAllLicenceType();
      }
  </code></pre>
  
  <p>My code actually download the excel file, but on the excel sheet it showing like
  <code>[Object][Object]</code></p>