Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

close window

Status
Not open for further replies.

janet24

Technical User
Jul 22, 2003
161
US
I'm trying to close an existing window...(not a pop-up window) with a confirm button.....

I have a function declared....

function close(){
var msgclose = "Are you sure you want to close?"
if(confirm(msgclose)) window.close();
}


then I call the funtion:

javascript:close();

In the button.

I get the confirm message but when I click ok the window doesn't close. It's a regular window not a pop-up window.

What am I doing wrong??

Thanks,
Janet24
 
Without testing, try renaming your close() method since obviously there is more there is a window.close() method with which you may be competing.

Also, if that doesn't work by itself, before your window.close(), add "window.opener=self;"

'hope this helps.

--Dave
 
I thought JScript could only close windows that JScript opened?

:-?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top