Re: Window close.
| From: | Jason Petersen | Date: | Tue, 07 Feb 2006 17:30:13 +0000 |
| Subject: | Re: Window close. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230052@lists.php.net to get a copy of this message | ||
On 2/7/06, Miles Thompson <miles@allnovascotia.com> wrote:
>
>
> Actually, expand it a little bit, and you avoid the JS Alert.
>
> function close_opener(){
> parentwin = window.self; // Make handle for current
> window named "parentwin"
> parentwin.opener = window.self; // Tell current window that it
> opened itself
> parentwin.close(); // Close window's parent (e.g..
> the current window)
> }
Interesting, but this code seems to be exploiting a flaw in certain browsers
(Internet Explorer). I believe the window.opener property is read-only in
Firefox and probably other browsers. At the very least, I wouldn't rely on
this method.
Jason