Javascript examples for Global:encodeURIComponent
Print file via Raw Using Javascript
<html> <head></head> <body> <button id="print">Print file</button> <script type="text/javascript"> function printZpl(zpl) {/* w w w. ja va2s . c o m*/ var printWindow = window.open(`data:text/html,<html><body><pre>${zpl}</pre><script>print();<\/script></body></html>`); printWindow.focus(); } var zpl = `asdfaasdfasdfasdfasdfasdfasdfasdf`; document.getElementById("print") .onclick = function() { printZpl(encodeURIComponent(zpl)) }; </script> </body> </html>