...

View Full Version : Is alert box required when using "javascript:window.close()"



psalms1493
06-01-2004, 06:35 PM
I am using a graphic link with "javascript:window.close()" in order to close a window. However, I don't want the box to pop up that says "the browser is trying to close the window. doyou want it to" or whatever the text is.

Is there any way to get rid of that prompt?

Basscyst
06-01-2004, 06:41 PM
I don't think so. For security purposes, I believe the only time it won't appear is if through the code, your page is the one that opened the window.

Basscyst

zoobie
06-02-2004, 06:42 AM
See if this works:

<script>
function bye() {
self.opener = this;
self.close()
}
</script>
</head>
<body>
<img src="hat.gif" onclick="bye()">

glenngv
06-02-2004, 08:02 AM
That is a bug exploit, so you can't rely on it to work in future releases.
http://www.codingforums.com/showthread.php?t=37466



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum