Dynamic hyperlink issue with Firefox | Dynamic element issue with different browsers

Publicado em: 31 Julho 2019
no canal de: Yogesh Kumbhat
14
0

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();
});
});


Nesta página do site você pode assistir ao vídeo on-line Dynamic hyperlink issue with Firefox | Dynamic element issue with different browsers duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Yogesh Kumbhat 31 Julho 2019, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 14 vezes e gostou 0 espectadores. Boa visualização!