Firefox doesn't allow any action to be performed on any element until its not there in DOM. Here is a code about adding the dynamic hyperlink to the DOM and make it work on all the browser.
$(document).ready(function(){
$("#download_button").click(function()
{
var req = new XMLHttpRequest();
req.open("GET", "/41138.docx", true);
req.responseType = "blob";
req.onload = function (event) {
alert("hi");
var blob = req.response;
var link=document.createElement('a');
link.href=window.URL.createObjectURL(blob);
link.download="sample.docx";
$("body").append(link);
link.click();
};
req.send();
});
});
На этой странице сайта вы можете посмотреть видео онлайн Dynamic hyperlink issue with Firefox | Dynamic element issue with different browsers длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Yogesh Kumbhat 31 Июль 2019, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 14 раз и оно понравилось 0 зрителям. Приятного просмотра!