homepage Welcome to WebmasterWorld Guest from 54.196.77.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
javascript:window.print() crashes IE6
when used with an image link
benihana




msg:1478855
 10:26 am on Jan 15, 2003 (gmt 0)

Hi
I have a popup window with the following code at the bottom to display links to close the window or print the page:

<a href="javascript:window.close();"><img src="images/close.gif" border=0></a>&nbsp;&nbsp;<a href="javascript:window.print()"><img src="images/print.gif" border=0></a>

the window.close works fine, but 90% of the time the window.print crashes IE6 when used with an image link. When I use it with a text link it works fine. It also works fine with an image in NS 7 and mozilla. Has anyone come across this before, or have any idea what the problem may be?
Thanks

 

Sinner_G




msg:1478856
 10:56 am on Jan 15, 2003 (gmt 0)

It works perfectly fine for me (Win2K, IE6).

Don't really think it is related, but I don't think you need the ; after the window.close().

Xuefer




msg:1478857
 1:12 pm on Jan 15, 2003 (gmt 0)

just a try: <a href="javascript:" onclick="window.print();return false"><img src="images/print.gif" border=0></a>

benihana




msg:1478858
 1:28 pm on Jan 15, 2003 (gmt 0)

fixed.
thanks very much :)

joshie76




msg:1478859
 4:21 pm on Jan 15, 2003 (gmt 0)

How did you fix it benihana?

Was it Xuefer's onclick suggestion or something else?

benihana




msg:1478860
 4:38 pm on Jan 15, 2003 (gmt 0)

yeah Xuefer's suggestion did the trick.

Xuefer




msg:1478861
 4:57 pm on Jan 15, 2003 (gmt 0)

hmm,..
seems my guessing is right.
when u click on a link, even it's "javascript:..."
or submit
the page maybe "going" to destruct(unload), or something else.
if u do something special, ie will crash

i used to get crash report from ie5.x users
that's when they submit a form and the js setTimeout to do something

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