Hi all,
I actually have a few questions.
1) Is it possible to have setTimeout() call a function? If so, how? I've tried using this:
<body onLoad="setTimeout(PostWelcome(), 10000);>
Obviously this isn't working. The function is called without regard to time (it's called immediately instead of the desired setTimeout).
2) I am trying to make a link do this:
Confirm:
if OK, the page will open a new window and close itself;
if CANCEL, the page will return to the page from which
the confirmation came (the welcome page).
While reverting users to a page which gives instructions on
how to enable JavaScript (sort-of a detection of whether or
not the user has JavaScript enabled).
My scripts look like this:
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
function PostWelcome(theURL,winName,features) {
var agree=confirm("Confirm your decision.\nClick OK to open the homepage to this site.\nClick CANCEL to exit.");
if (agree) {
window.open("/Home/1/%7E.htm",'','toolbar=no,resizable=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no');
self.close
}
}
-->
</script>
</head>
<body>
<p class=MsoNormal align=center style='text-align:center'><span
style='font-size:150.0pt;font-family:"Palace Script MT"'><a href=http://www.webdeveloper.com/forum/archive/index.php/"/EnablingJavaScript,Cookies&ActiveXControls/%7E.htm"
onClick="PostWelcome(); return false;">Welcome</a></span></p>
</body>
Now what happens is, the second window opens but the
original window doesn't close itself.
I actually have a few questions.
1) Is it possible to have setTimeout() call a function? If so, how? I've tried using this:
<body onLoad="setTimeout(PostWelcome(), 10000);>
Obviously this isn't working. The function is called without regard to time (it's called immediately instead of the desired setTimeout).
2) I am trying to make a link do this:
Confirm:
if OK, the page will open a new window and close itself;
if CANCEL, the page will return to the page from which
the confirmation came (the welcome page).
While reverting users to a page which gives instructions on
how to enable JavaScript (sort-of a detection of whether or
not the user has JavaScript enabled).
My scripts look like this:
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
function PostWelcome(theURL,winName,features) {
var agree=confirm("Confirm your decision.\nClick OK to open the homepage to this site.\nClick CANCEL to exit.");
if (agree) {
window.open("/Home/1/%7E.htm",'','toolbar=no,resizable=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no');
self.close
}
}
-->
</script>
</head>
<body>
<p class=MsoNormal align=center style='text-align:center'><span
style='font-size:150.0pt;font-family:"Palace Script MT"'><a href=http://www.webdeveloper.com/forum/archive/index.php/"/EnablingJavaScript,Cookies&ActiveXControls/%7E.htm"
onClick="PostWelcome(); return false;">Welcome</a></span></p>
</body>
Now what happens is, the second window opens but the
original window doesn't close itself.