Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: open

javascript:window.print() crashes IE6

when used with an image link

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

WebmasterWorld Senior Member 10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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().

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

10+ Year Member



just a try: <a href="javascript:" onclick="window.print();return false"><img src="images/print.gif" border=0></a>
1:28 pm on Jan 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



fixed.
thanks very much :)
4:21 pm on Jan 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How did you fix it benihana?

Was it Xuefer's onclick suggestion or something else?

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

WebmasterWorld Senior Member 10+ Year Member



yeah Xuefer's suggestion did the trick.
4:57 pm on Jan 15, 2003 (gmt 0)

10+ Year Member



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

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month