Print -friendly code doesn't work in Netscape

Firefox, Thunderbird, SeaMonkey, Camino, Mozilla, Netscape 6/7/8/9, and all Gecko-based browsers discussion and support forum.
(MozInfo701, Netscape Browser Archive)

Moderators: Fulvio, profman, Ramona, Antony, Edward

Print -friendly code doesn't work in Netscape

Postby Bruce » Wed 26 Jun, 2002 2:00 am

Hi

I have the following piece of Javascsript which hides the entire page then only shows a the div called "content". This div is the print firendly version of the page. It works fine in IE but not in any version of Netscape -- any help would be much appreciated!

function showPrinterFriendly() {
// deletes all menus content etc. from the document
// then add just the content back
var strContent = document.all.divContent.innerHTML;
while( document.body.firstChild) {
document.body.firstChild.removeNode(true);
}
newDiv = document.createElement('DIV');
document.body.appendChild( newDiv);
newDiv.innerHTML = strContent;
window.print();
alert ("Click OK when printing is complete.");
history.go();
}
Bruce
 

Postby Antony » Wed 17 Jul, 2002 11:20 pm

Danny Goodman mentioned the JavaScript printing methods in his Dynamic HTML - The Definitive Reference.
User avatar
Antony
diamond member
diamond member
 
Posts: 14930
Joined: Tue 18 Jun, 2002 11:36 pm
Location: Sydney, Australia


Return to Firefox, SeaMonkey and Netscape

Who is online

Registered users: Bing [Bot], Google [Bot]