niche Posted June 24, 2012 Share Posted June 24, 2012 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 More sharing options...
niche Posted June 24, 2012 Author Share Posted June 24, 2012 Found it! location.replace() Thanks for your time. Link to comment Share on other sites More sharing options...
ShadowMage Posted June 25, 2012 Share Posted June 25, 2012 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now