Jump to content

new page with onclick


niche

Recommended Posts

Isn't there a method that I can use with onclick to display a different page? I thought something with link() would work, but no go. Something like this:

<!DOCTYPE html><html><head><script type="text/javascript">function logon() {    // redirect here}</script></head<body>    <button  onclick="logon()">Logon</button> </body></html>

Link to comment
Share on other sites

If I remember correctly, assign will place an entry in the browser history and allow the user to use the back button to get back to the previous page while replace does not. So if you want to maintain the history, you'll want to use assign instead of replace.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...