I am trying to send a user to another page using a Javascript Function:
<
try this:
window.location.href = "YOUR_RELATIVE_PATH_HERE"
ex ./pages/aboutus"
You can also use a meta refresh tag to redirect.
<meta http-equiv="refresh" content="2;url=http://other-domain.com">
Will redirect to the site http://other-domain.com
after two seconds.
try this!
window.location.replace("http://www.link.com");
window.location.href = url;
It is ok for redirecting to the required url using javascript.
The simple example can be found in this url
I believe window.location.href = "newpage.html";
will work.
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: