I need to redirect a page after a prompt [like in SMF when you recieve a message], how can this be done?
- Thanks
Just change window.location.href.
-[Unknown]
I'm using this:
function message()
{
var Your_Name = confirm("You have recieved a message, do you wish to view it?")
if (Yes_or_No == 1) { // user clicked ok.
window.location.href = '/?page=test'
}
}
</head>
<body onload="message();">
Whats wrong with it?
- Thanks
You're using different variables. I would just use:
if (confirm("You have recieved a message, do you wish to view it?"))
window.location.href = '/?page=test';
-[Unknown]
Thanks