[jQuery] Printer Friendly help

[jQuery] Printer Friendly help


Hi everyone,
I'm launching the following code from an onclick="return
printerFriendlyPage();" call. When I do this the page is reformatted and
displayed in all of it's printer friendly glory. The problem is, I need it
to pop up in a new window. Anyone have any suggestions on this? I'm a jQuery
newbie so pardon any code mistakes. :)
Thanks,
Jenny
function printerFriendlyPage() {
$("div#printerFriendly").remove();
var content = $("div#custom-doc").get();
$("head").empty();
$("body").empty();
$('<head><title>Some Site</title><link rel="stylesheet"
href="/css/reset-fonts-grids.css" type="text/css" /><link rel="stylesheet"
href="/css/standard.css" type="text/css" /><link rel="stylesheet"
href="/css/content.css" type="text/css" /><link rel="stylesheet"
href="/css/smallFonts.css" type="text/css" /><link rel="stylesheet"
href="/css/printerFriendly.css" type="text/css" /><link rel="stylesheet"
href="/css/print.css" type="text/css" media="print"
/></head>').appendTo("head");
    
$("body").attr("id","content");
$('<div id="custom-doc"><div id="printerFriendlyTools"><div id="close"> #
Close </div><div id="print"> # Print </div></div><div
id="printerFriendlyContainer"></div><script type="text/javascript">var
printerFriendly =
document.getElementById("printerFriendly");printerFriendly.style.display="none";</script></div>').appendTo("body");
$(content).appendTo("div#printerFriendlyContainer");
}
--
View this message in context: http://www.nabble.com/Printer-Friendly-help-tp16038822s27240p16038822.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.