PDA

View Full Version : javascript:window.print not working on Macs



Liz
Dec 6th, 2002, 07:06 PM
I have a page that opens a window that doesn't have a menu bar. So that users can still print, I have a link at the top entitled "Print."

The link works fine in IE 5 and 6 for Windows but doesn't print on Macs in IE 5 (haven't tested 6).

My code:
<a href="#" onClick="javascript:window.print();">

or

<a href="onClick="javascript:window.print();">

(I also tried the shorter version:
<a href="onClick="javascript: print();">

Thank you for your help.

Liz

A1ien51
Dec 6th, 2002, 07:13 PM
I believe that Macs do not support that property

Liz
Dec 6th, 2002, 07:24 PM
Is there a workaround?

The only other solution is to display the menu bar (not very elegant) :(

Liz

beetle
Dec 6th, 2002, 07:37 PM
Indeed, MSDN's page on window.print() (http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/print.asp) does not indicate support for the Mac version.

Since javascript is pretty much your only tool for doing this sort of thing, I'd say that a workaround probably doesn't exist.

Liz
Dec 6th, 2002, 07:43 PM
Well... that sounds like a definitive answer and that is a big help for my client and me.

Thank you, Alien51 and beetle!

Liz