internet explorer - click() function jquery not working on IE phpword -
i sending javascript object backend, phpword can generate docx file. on chrome , mozilla working. in ie on other hand, says "access denied" , highlighting "link.click"
here code:
addword['gsm'] = gsm; addword['rtu'] = rtu; addword['tcp'] = tcp; var content = json.stringify(addword); var req = new xmlhttprequest(); var urlgendocx; if (location.hostname == "localhost") { urlgendocx = "/vendor/gendocx.php"; //console.log(location.hostname); } else { urlgendocx = "vendor/gendocx.php"; //console.log(location.hostname); } req.open("post", urlgendocx, true); //req.open("post", "vendor/gendocx.php", true); req.responsetype = "blob"; req.onload = function (event) { var blob = req.response; var link = document.createelement('a'); document.body.appendchild(link); link.href = window.url.createobjecturl(blob); var dt = new date(); var time = dt.gethours() + ":" + dt.getminutes() + ":" + dt.getseconds(); var filename = globaluserinfo.login.lastname + '_' + $('#offerno_input').val() + '_' + $.datepicker.formatdate('dd m yy', new date()) + '_' + time; link.download = filename; link.click(); settimeout(function () { document.body.removechild(link); }, 500) }; req.send(content);
Comments
Post a Comment