...

View Full Version : how do I make a webpage reopen itself on close? #2



dlg0351
01-26-2005, 04:41 PM
I saw that someone posted this question before and I thought I would try and write a script to do it.


Can someone tell me why this DOES NOT work:
<html>
<head>
<title></title>
<script language="Javascript">
<!--
function openWindow()
{
var openWindow = window.open(test.html);
}
//-->
</script>
</head>
<body onUnLoad="openWindow();">
test
</body>
</html>


But this script DOES work:

<html>
<head>
<title></title>
<script language="Javascript">
<!--
function alertMessage()
{
alert("fsfasfsffsadfsadfdasf");
}
//-->
</script>
</head>
<body onUnLoad="alertMessage();">
test
</body>
</html>

I am just curious. Thanks.

-Dave
PROWEBWORKS.NET

looka
01-26-2005, 05:24 PM
people hate pop-uping. expecially when u want to close certain page..

dlg0351
01-26-2005, 06:36 PM
I totally agree, I don't plan to use it, I am just curious why it doesn't work.

AlterEgo
01-26-2005, 07:00 PM
Opening a window is a function (it does something), not a variable (storing a value). So having it as a variable would not work.

glenngv
01-27-2005, 01:44 AM
You missed the quotes.

function openWindow()
{
var openWindow = window.open("test.html");
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum