Hi,
I'm trying to create a printer-friendly javascript function that will be included on all pages of my site. I have a link on the page that calls a function called showPrintPage(). This is the code for that function:
Code:
function showPrintpage(){
document.getElementById("dontPrintTop").style.display = "none";
document.getElementById("dontPrintLeft").style.display = "none";
document.getElementById("copyright_td").style.display = "none";
document.getElementById("relatedlinks_td").style.display = "none";
document.getElementById("printerFriendlyRow").style.display = "none";
document.getElementById("hide").style.display = "inline";
window.print();
}
... on each web page via an include...
Code:
<a href="" class="printerFriendlyRow" onclick="showPrintpage();">Printer-friendly page</a>
It hides all the "fluff" navigational things and then prints the page. Right now I'm testing it on Netscape 7.1 and IE 6.0.
It works like I want it to in Netscape 7.1 but in IE 6.0, after some time, it refreshes to the index page in that current directory.
Any ideas on what is causing this?
Also, I'm trying to set the timeout to have a longer delay in refreshing on both browsers but haven't figured out the code for that part yet.
Thanks,
Patricia