JavaScript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?"
 
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?"
 
No.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: Richard Harker [mailto:Richard (e-mail address removed)]
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top