Click here to Skip to main content
15,908,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

i have a php page in a javascript function i want to redirect to another page .
i used

JavaScript
window.location.href = "http://www.google.com/";
return false;


but there was no senese in it.

any help , please???

thanks
Posted

1 solution

Try
JavaScript
window.location = "http://www.google.com/";

See more
Javascript Redirect Scripts[^]
 
Share this answer
 
v2
Comments
moon2011 13-Nov-11 4:29am    
Not Working Also...
thatraja 13-Nov-11 4:31am    
Check the link in my updated answer.
Also check the browser debugger for any js errors. If exists then include that in your question
moon2011 13-Nov-11 4:30am    
<script type="text/javascript">
function displaymessage()
{

var username = document.getElementById('fusername').value;
var userpassword = document.getElementById('fpassword').value;

if ((username=="user") && (userpassword =="111"))
{


window.location = "http://www.google.com/";


}




}


</script>


This is my function
thatraja 13-Nov-11 4:32am    
Is the username & userpassword values are matching?
moon2011 13-Nov-11 4:37am    
yes, there are correct

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900