here is my issue.
I'm generating excel file in a PHP function (with Zend Framework 2). Sometimes, the generating process can be long, too long (25 seconds+), so I decided to create a modal based structure to display a loader so the user is not confused.
I'm trying, with Jquery, to know when the excel file is generated and downloaded so that I can hide the loader. The file is generated simply by clicking a link :
<a href="linkToGenerateMyExcelFile">Download excel file</a>
The following code generates and downloads the excel file, but does not allow me to know when it's done :
$(function() {
$(document).on('click', ".btn-export", function(event){
event.preventDefault();
$("#myModal-export .loader").removeClass("hide");
var url = $('.btn-export').attr("href");
$(location).attr("href", url);
});
});
Is there any way to know when a link is completly loaded ? Actualy, I have no idea.