p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_discuss thread: Disable the close button of IE


Message #1 by "cindy zhou" <czhou@w...> on Mon, 17 Mar 2003 15:59:36
Hi,

Anyone knows how to disable the close button on IE brower? I have a window 
which opens a pop-up window, and I want the newly pop-up window to be 
closed by my close button instead of the close button(x) of IE.

Thanks,
Cindy
Message #2 by s.lydford@l... on Tue, 18 Mar 2003 09:38:54
Your best bet would probably be to use Javascript to open the new window 
chromeless. Be aware though that this doesn't always work cross-browser.

> Hi,

> Anyone knows how to disable the close button on IE brower? I have a 
window 
w> hich opens a pop-up window, and I want the newly pop-up window to be 
c> losed by my close button instead of the close button(x) of IE.

> Thanks,
C> indy
Message #3 by Richard Mason <richard.mason@e...> on Wed, 19 Mar 2003 08:13:55 -0000
Whatever code you want to be triggered by your close button, put it in the "onunload" event of the body
element instead - eg <body onunload="myfunction()">. That way it will trigger however the window
is closed, assuming Javascript is enabled. 

Now you can use an accessible <a target="_blank"> link to open your new window instead of JS, and you can put some text in a
<noscript> element to inform users without JS that your pop-up page may not
function correctly without it.

Rick


-----Original Message-----
From: s.lydford@l... [mailto:s.lydford@l...] 
Sent: Tuesday, March 18, 2003 9:39 AM
To: asp_discuss
Subject: [asp_discuss] Re: Disable the close button of IE


Your best bet would probably be to use Javascript to open the new window 
chromeless. Be aware though that this doesn't always work cross-browser.

> Hi,

> Anyone knows how to disable the close button on IE brower? I have a
window 
w> hich opens a pop-up window, and I want the newly pop-up window to be
c> losed by my close button instead of the close button(x) of IE.

> Thanks,
C> indy


-----------------------------------------------------------------------

This message is intended for the use of the addressee 
only and may contain confidential or privileged information. If you 
have received it in error please notify the sender and destroy it.  
You may not use it or copy it to anyone else.

E-mail is not a secure communications medium.  
Please be aware of this when replying.

Although East Sussex County Council has taken steps to ensure 
that this e-mail and any attachments are virus free, we can take 
no responsibility if a virus is actually present and you are advised to 
ensure that the appropriate checks are made.


  Return to Index