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

Pubblicato il: 31 luglio 2019
sul canale di: 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();
});
});


In questa pagina del sito puoi guardare il video online Dynamic hyperlink issue with Firefox | Dynamic element issue with different browsers della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Yogesh Kumbhat 31 luglio 2019, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 14 volte e gli è piaciuto 0 spettatori. Buona visione!