I\'m attempting to return an Excel file through a Ajax POST
to the server, the server generates the .xls file, however it doesn\'t pass through to the front end, i
Try this http://jsfiddle.net/abLeR/
It downloads a tar file using hidden iFrame and ajax. Same can be used for the xls file.
HTML
Download
Javascript
$(".download").click(function (e) {
e.preventDefault();
var link = $(this);
$('.loading').show();
$.ajax({
type: 'HEAD',
url: link.attr('href'),
complete: function () {
$('.loading').hide();
var ifr = $('').attr('src', link.attr('href')).hide().appendTo(link)
setTimeout(function () {ifr.remove();}, 5000);
}
});
});