Hi guys
Is there anyway in JavaScript to print a link.
eg. window.Print (www.netscape.net).
I want the target page to go to the printer??
Please help with this, I'm really stuck
There is a window.print() that prints the current page "as if the user had clicked the browser's print button." I doubt you can print another page or site, and I doubt the validity of window.print(), as if a user wants to print a page, they can print it themselves, else you're just hijacking their printer.
Josh
Get these: MozillaOperaOpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
It is possible, I can't find the code for it at the moment but I'll have a look.
As for the usefulness, you can't get around the Windows print dialog box but it does automate printing as much as possible and of course you can control navigation etc.
i don't think that window.print() works in netscape...but what else is new!
I got it out of the Rhino book. I wouldn't be surprised if Netscape disabled it in later versions for security reasons. There's no good reason why a web author should have script access to the user's print functions.
Josh
Get these: MozillaOperaOpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
I agree if you're talking about normal web pages but I write many web based applications that require automated printing and navigation. It does have it's uses!
That's what I'm writing. I've got an application that generates reports. there could be upto 20 reports at a time. I really need to know if anyone has any code that can automate this printing.
I'd really appreciate anyone that may be able to help me with this. I've beenstuck for about three days just on this problem.
Thanks again
JK
The code actually works which is great(Thanks fsystem). But it has problems with IE4.0. It is pretty complicated for what it does.
Just out of interest, any suggestions on how to do it a different way??