I encountered an issue with my code under Mi browser. I cannot find a vanilla javascript solution to download a part of my page as html. The code that is functional on Chrome or Firefox doesn't work in Mi. Part of my code:
var elHtml = ""+document.getElementById("hlavicka").innerHTML +""+ document.getElementById("stranka").innerHTML + ""; if (navigator.msSaveBlob) { // IE 10+ navigator.msSaveBlob(new Blob([elHtml], { type: mimeType + ';charset=utf-8;' }), filename); } else { var link = document.createElement('a'); document.body.appendChild(link); mimeType = mimeType || 'text/plain'; link.setAttribute('download', filename); link.setAttribute('href', 'data:' + mimeType + ';charset=utf-8,' + encodeURIComponent(elHtml)); link.click(); }
Could you please give me a hint?