Today, I want to make a small function of printing web pages and call Window.print () directly, but after printing, the font always shrinks the number one, and the reason cannot be found. Essence Essence
Later, I tried to use an IE printing control, but only supporting IE was a little nauseous, and I could only return to find the reason.
It turned out that the page I was going to print was that because of the brother pop -up layer, so this phenomenon appeared. Later, it was directly target = "_ Blank" to print normally.
in addition,
Copy code code as follows:
Function Preview ()
{{
bdhtml = window.document.body.innerhtml;
sprnstr = "<!-Startprint->" ";
eprnstr = "<!-Endprint->" ";
prnhtml = bdhtml.substring (bdhtml.indexof (sprnstr) +17);
prnhtml = pRNHTML.Substring (0, PRNHTML.INDEXOF (EPRNSTR));
window.document.body.innerHtml = PRNHTML;
window.print ();
}
</script>
Putting <!-Startprint-> and <!-Endprint-> at the beginning and end of the content that needs to be printed, only the required parts are printed, not the entire page. (Look at the blogs of others, hehe)