Forum Moderators: open
i tried to redirect user to "some site" in a new window after they click OK,
and didnt do anything when they click CANCEL (remain in the same page).
how can i do it?
function some_function(some_site)
{
if (confirm("yes no"))
{
window.location=some_site;
}
else
{
quit();
}
}
i used this function....is it a proper function?(i just can't get it work) help me plz...
<html><head><title></title></head>
<body>
<form>
<input type="button" onClick="some_function('http://www.example.com');" value="Go to Monkeys Rule The World">
</form>
<script language="javascript">
function some_function(some_site) {
var confirmed = confirm("Do you want to go to Monkeys Rule The World dot com?")
if (confirmed == true) {
var day = new Date; // These insure a unique window each
var id = day.getTime(); // time one is opened (instead of same window)
var params = 'width=400,height=500,scrollbars,resizable';
var win = open(some_site,id,params);
}
//Note there's no 'else.' The above only happens if OK is selected.
}
</script>
</body>
</html>