I am trying to send a user to another page using a Javascript Function:
<input type="button" name="confirm" value="nextpage" onClick="message()">
And my JavaScript:
function message() {
ConfirmStatus = confirm("Install a Virus?");
if (ConfirmStatus == true) {
//Send user to another page
}
}
Does anyone know how to send a user to another specific page?
your code got messed up, but if I got it right you can use the following:
location.href = 'http://www.google.com';
or
location.href = 'myrelativepage.php';
Good luck!
But I must say to you,
Other option is to do this by code:
PHP: header('Location: index.php');
C#: Response.Redirect("yourpage.aspx");
Java: response.sendRedirect("http://www.google.com");
Note: