Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Printer Friendly feature - works in IE not FF
Old 09-18-2009, 12:31 PM Printer Friendly feature - works in IE not FF
Junior Talker

Posts: 1
Name: Brock Kalef
Trades: 0
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();
}
Karch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Printer Friendly feature - works in IE not FF
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08521 seconds with 12 queries