Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

print js css not working

function printReceipt(el) {
  var w = window.open();

  w.document.write('<html><head><title></title>');
  w.document.write('<link rel="stylesheet" type="text/css" href="css/receipt-print.css">');
  w.document.write('</head><body >');
  w.document.write(document.getElementById(el).innerHTML);
  w.document.write('<script type="text/javascript">addEventListener("load", () => { print(); close(); })</script></body></html>');

  w.document.close();
  w.focus();
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to use react-native-vector-icons 
Javascript :: array 
Javascript :: Destructuring array and object from a nested object 
Javascript :: sum array elements in javascript 
Javascript :: tailwind rn npm install 
Javascript :: embed a picture from a link js 
Javascript :: delete request reaxt 
Javascript :: difference node and npm 
Javascript :: js multiline string with variables 
Javascript :: chrome extension contextmenus 
Javascript :: how to change the text of a paragraph 
Javascript :: s3.getobject nodejs example 
Javascript :: js replace whole word and not words within words 
Javascript :: how to end a javascript program 
Javascript :: jquery if in page 
Javascript :: regex checker 
Javascript :: how to add jquery to an html css and javascript project 
Javascript :: convert Component Did mount into useEffect 
Javascript :: find array in js 
Javascript :: delete in array 
Javascript :: empty object is falsy 
Javascript :: javascript sorting an array 
Javascript :: js localstorage clear 
Javascript :: how to use cros 
Javascript :: clear dict javascript 
Javascript :: how to compare two strings in javascript if condition 
Javascript :: js dataset 
Javascript :: jquery pass $ 
Javascript :: computed property names 
Javascript :: recaptcha v3 js 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =