JavaScript

R

Richard Harker

Hi All,

I am currently using the following script to close a window;

<a href="javascript:void(0);" onclick="self.close();return false;"><img src="CLOSE.gif"></a>

When the page is closed a message box pops up asking: "The web page you are viewing is trying to close the window, Do you want to close the window?"

Is there a switch that can be used in the script to automatically select "yes"???

(I Know nothing about JavaScript)!!!!


Any help would be greatly appreciated

Thanks

Richard Harker
 
T

Thomas A. Rowe

You get the warning because you trying to close a normal browser window. You need to open the window
as a JavaScript popup.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


Richard Harker said:
Hi All,

I am currently using the following script to close a window;

<a href="javascript:void(0);" onclick="self.close();return false;"><img src="CLOSE.gif"></a>

When the page is closed a message box pops up asking: "The web page you are viewing is trying to
close the window, Do you want to close the window?"
 
K

Kevin Spencer

Try the following:

onclick="window.opener = self; window.close()"

The dialog pops up because the opener property of the window is null.
Setting the opener property to self suppresses the dialog.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Richard Harker said:
Hi All,

I am currently using the following script to close a window;

<a href="javascript:void(0);" onclick="self.close();return false;"><img
src="CLOSE.gif"> said:
When the page is closed a message box pops up asking: "The web page you
are viewing is trying to close the window, Do you want to close the window?"
 
J

Jens Peter Karlsen[FP-MVP]

No.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: Richard Harker [mailto:Richard [email protected]]
Posted At: 05. august 2004 13:03
Posted To: microsoft.public.frontpage.client
Conversation: JavaScript
Subject: JavaScript


Hi All,

I am currently using the following script to close a window;

<a href="javascript:void(0);" onclick="self.close();return false;"><img
src="CLOSE.gif"></a>

When the page is closed a message box pops up asking: "The web page you
are viewing is trying to close the window, Do you want to close the
window?"

Is there a switch that can be used in the script to automatically select
"yes"???

(I Know nothing about JavaScript)!!!!


Any help would be greatly appreciated

Thanks

Richard Harker
 
Top