Window. Print is a simple printing method in IE printing.
By default, window. Print prints the header and footer. You can use JavaScript to remove the header and footer.
Function doprint (){
/// Hide the content that does not need to be printed
Try
{
Pagesetup_null ();
}
Catch (E)
{
VaR errormsg = E. set message + "\ r" +: IE options-> Security-> Internet-> "+" ActiveX controls and ins "+" \ r "+" initialize and execute scripts for ActiveX controls that are not marked as scripts for security-> allow/prompt ";
Alert (errormsg );
Return;
}
Window. Print ();
}
</SCRIPT>
<SCRIPT type = "text/JavaScript" Language = "JavaScript">
VaR hkey_root, hkey_path, hkey_key;
Hkey_root = "HKEY_CURRENT_USER ";
Hkey_path = "\ Software \ Microsoft \ Internet Explorer \ pagesetup \\";
// Set the page header and footer to be empty.
Function pagesetup_null ()
{
VaR wsh = new activexobject ("wscript. Shell ");
Hkey_key = "Header ";
Wsh. regwrite (hkey_root + hkey_path + hkey_key ,"");
Hkey_key = "footer ";
Wsh. regwrite (hkey_root + hkey_path + hkey_key ,"");
Hkey_key = "margin_left"
Wsh. regwrite (hkey_root + hkey_path + hkey_key, "0"); // key value setting -- left boundary
Hkey_key = "margin_top"
Wsh. regwrite (hkey_root + hkey_path + hkey_key, "0"); // key value setting -- upper boundary
Hkey_key = "margin_right"
Wsh. regwrite (hkey_root + hkey_path + hkey_key, "0"); // key value setting -- Right Border
Hkey_key = "margin_bottom"
Wsh. regwrite (hkey_root + hkey_path + hkey_key, "0"); // key value setting -- bottom boundary
}