I have an hom.html page where i have username and password fields.. I get those values thru JavaScript.. If these things match with my un and pwd it goes to another page.Else it shows an error message. Here the window.location.href is not working. I tried window.open where it opens a new window by leaving the existing window still exists. I need a page opens within the same window just like response.sendRedirct in JSP..Pls sum one help me to resolve this. Any help would be appreciated...
Originally posted by Rodrigo Lopes: What happened when you tried window.location = "home.html"?
window.location is not one of the "best practices" of JavaScript. You should use .href as the poster orginally did.
Here the window.location.href is not working.
What is not working? Are you getting an error message? Is the page reloading? Is the world catching on fire? We need some more details and you may want to show us how you are calling your function with a button, link, keyoress etc.