There was a question about how to make the processbar during file generation. I tried this:

$("#download-button").click(function () { var req = getXHR(); req.open('GET', '/Home/DownloadImage', true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4 && req.status == 200) { $('#progressMsg').hide(); } }; $('#progressMsg').show(); req.send(null); }); 

In Chrome and IE everything works fine, but does not work in FireFox .

More specifically: all the time it shows that req.status = 0 ; while in Chrome = 200;

  • @PavelMayorov I apologize, poorly copied. Already fixed. - kxko
  • You yourself do not notice that your question is about javascript, and not about asp.net mvc? - Pavel Mayorov
  • In essence, the question is - you obviously erased something extra. The code above looks like a working ... - Pavel Mayorov
  • @PavelMayorov in Chrome - yes, it works. in Firefox, my progress bar does not disappear (.hide ()). Since it is not included in the condition IF (as for some reason, req.status == 0). - kxko
  • @PavelMayorov is interesting that when I change the value of "async" to false, it returns state 200, as it should. - kxko

0