Solved

Printing in Kiosk Mode/Frames

Posted on 1998-06-25
3
316 Views
Last Modified: 2012-05-04
Hi, I'd like to implement a Print button on my web page - thus removing the need to give the user access to the menu options (running in kiosk mode).

Can this be done (e.g. in Javascript)?  A complication may be that the data to print will be in a different frame to the print button, so there may be an issue with which frame has focus when the button is pressed.

Regards, Maddy.
0
Comment
Question by:maddy051398
3 Comments
 
LVL 5

Expert Comment

by:julio011597
Comment Utility
parent.frameToPrint.print()

which surely works in NN4.

-julio
0
 

Author Comment

by:maddy051398
Comment Utility
I tried the following (not worrying about frames) which works in NN4 but not IE4:

<INPUT TYPE="reset" NAME="button1" VALUE="Print" onClick = "PrintMe()">
<SCRIPT LANGUAGE="JAVASCRIPT">
function PrintMe()
{
   parent.print ()
}
</SCRIPT>

Any suggestions?  I've looked in a couple of IE4 and Javascript books and can't find any reference to a print method.  In IE4 I get the 'Object doesn't support this property or method' script error when I press the button.

Regards, Maddy
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 50 total points
Comment Utility
This one should work in MSIE and Netscape 4

<object id=WBControl width=0 height=0 classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></object>
<SCRIPT LANGUAGE=VBScript><!-- //
   Sub VBPrint() On Error Resume Next
      WBControl.ExecWB 6,1
   End Sub
// --></SCRIPT>

<SCRIPT LANGUAGE=JavaScript><!-- //
if (navigator.appName.indexOf('Microsoft') !=-1)
   document.write('<FORM><INPUT TYPE="BUTTON" ONCLICK="VBPrint()" value="Print"></FORM>');
else if (self.print)
   document.write('<FORM><INPUT TYPE="BUTTON" ONCLICK="self.print()" value="Print"></FORM>');
// --></SCRIPT>

this will print the page it is on. Other-frame printing will need the onclick(s) to execute a function in the frameset head, passing the name or number of the frame to print

Enjoy,

Michel
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now