Skip to main content
December 13, 2006
Answered

Printing Button on WebHelp Skin

  • December 13, 2006
  • 13 replies
  • 3083 views
Hi,

I am generating webhelp.

I was able to follow the instructions and create a custom button on the WebHelp Skin and to print the topic which is open. When I try to print it prints a page with the Toolbar of the skin but no contents..

Code used

if (top.frames[1].frames[1].frames[1] != null)
{
top.frames[1].frames[1].frames[1].focus(); window.print();
}
else
{
top.frames[1].frames[1].focus(); window.print();
}

Please help
This topic has been closed for replies.
Correct answer Roger_N
kewel -

It seems that IE tabs don't affect the frame references.

The script you were using instructed the browser to, if the toolbar frame exists, print it; otherwise, print the contents frame. Well, you always have the toolbar frame if you see the print button, so it makes no sense.

All you really need is the second print statement in your Inline Javascript:

function PrintIt()
{
top.frames[1].frames[1].focus(); window.print();
}

...and be sure to add PrintIt() to your onclick event.

13 replies

December 13, 2006
Hi Rick,

hmmm..this didnt work..
I replaced my code with code above code..

:|
December 13, 2006
Hi Rick,

To be honest I dont remeber it where I got the script but until i recall it was from one of the forums which directed me to Peter's or one the great authors like you
:)


Captiv8r
Legend
December 13, 2006
Hi again

Have you tried the script in my Skinny on Skins file?

javascript:parent.frames[1].bsscright.focus();window.print();

Maybe that will help? Rick
Captiv8r
Legend
December 13, 2006
Hi Kewal

Where did you get your script? Your description seems to imply that you are simply printing the frame the button is in. Also, what browser and version?

Cheers... Rick