homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Using the window.print() method in Javascript
Crossbrowser support

 4:54 pm on Jun 5, 2003 (gmt 0)


I have a web page at the following url


At the bottom of the page is a link to print the page. Now this seems to work on Windows PC's but not on Mac in Internet Explorer.

The code i have used is below and I just wondered if any one knew of a way to get this to work in Explorer. The code seem to work in Netscape on the Mac and as I have said there is no problem in Explorer on windows PC's

<a href="JavaScript: onclick=window.print();" class="hlink">print</a>

Any ideas on this would be appreciated.


[edited by: korkus2000 at 5:07 pm (utc) on June 5, 2003]
[edit reason] no personal URLs please [/edit]



 5:14 pm on Jun 5, 2003 (gmt 0)

IE5+ will do window.print. Call the method without the onclick in the href like:

<a href="JavaScript:window.print();" class="hlink">print</a>


 5:22 pm on Jun 5, 2003 (gmt 0)

Save the code and drop the link. "Print" is just a mouseclick or keystroke away by default.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved