I'm new to this forum and looking forward to seeing it in action
Can anyone help me figure out why this printer friendly code is not working in Firefox?
I've played briefly with CSS for this but was not able to get it to work either. My fear is that the web framework we are using for this app gets in the way.
I can get the below code to display simple HTML in FireFox if I remove the function parameters and write simple HTML. However as soon as I try and retrieve content from ID's on the page being called from, I get a new window with no content. It works perfectly in IE.
A little about my situation. My big problems here is that I'm a novice at Javascript and cross-browser issues. I work on Intranet websites for our client who has a locked build for all systems in the company and they only have IE 6 installed. This particular project spans outside if the Intranet to the Internet and I'm forced to deal with other browsers.
I've been trying to find something online to help with this for the past two days and nothing seems to work.
Thanks in advance.
Code:
function CallPrint(strid, strid2)
{
var prtContent = document.getElementById(strid);
var prtContent2 = document.getElementById(strid2);
var WinPrint = window.open('','','left=0,top=0,width=850,height=600,toolbar=0,scrollbars=1,status=0');
WinPrint.document.write(prtContent.innerHTML + '<br>' + prtContent2.innerHTML );
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
|