Window.Print() fails on Mac IE 5.2

M

Mark Findlay

I am using the standard print link in my web page for printing:

<a href="#" onClick="javascript:window.print(); return false;">PRINT
PAGE</a>

and it works fine on every browser and platform I've tested on EXCEPT Mac IE
5.2

Does anyone know of a way to get this to work on Mac IE 5.2?

Many thanks!
 
M

Mick White

Mark said:
I am using the standard print link in my web page for printing:

<a href="#" onClick="javascript:window.print(); return false;">PRINT
PAGE</a>

and it works fine on every browser and platform I've tested on EXCEPT Mac IE
5.2

Does anyone know of a way to get this to work on Mac IE 5.2?

Many thanks!
function printDoc(){
if(window.print){window.print(); return}
if(navigator.userAgent.toLowerCase().indexOf("mac")!=-1){
alert("Press Command+P"); return;
}
alert("You may need to press Control+P to print page\nor consult your OS
specifications")
}

<a href="#" onClick="printDoc(); return false;">PRINT
PAGE</a>

Mick
 
T

Thomas 'PointedEars' Lahn

Mark said:
I am using the standard print link in my web page for printing:

<a href="#" onClick="javascript:window.print(); return false;">PRINT
PAGE</a>

and it works fine on every browser and platform I've tested on EXCEPT Mac IE
5.2

Does anyone know of a way to get this to work on Mac IE 5.2?

Remove the "javascript:" nonsense, see the FAQ, and write the
link dynamically, see <If that does not help, check if the "window" *host* object has
even a print() method (you should use feature testing always),
see <http://pointedears.de/scripts/test/whatami>.

BTW: Note that ECMAScript/J(ava)Script is case-sensitive.


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top