Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

Please give solution for this issue

I tried the following in ajax
JavaScript
window.location.ahref = "dashboard.php";

but this code not working.

When I take total path of url then it is working, but I want give only filename..
Please give solution for this.

My code is here
JavaScript
<script type="text/javascript">
$(document).ready(function(){
	$("#login").click(function(){
	
 	    username=$("#username").val();
            password=$("#password").val();
		
	    $.ajax({
                type: "POST",
                url: "logind.php",
                data: {
                         user: username,
                         pass: password
                      },
                success: function(msg){
           
                      if(msg == 0) {
				$required.html("username and password wrong.........").dialog('open');
				
                      }
                      else {
			        alert(msg);
                                window.location.ahref = "dashboard.php"; 
                      }
                }
             });

             return false;
         });
		
	 return true;
});
</script>
Posted
v2
Comments
I guess that is window.location.href not window.location.ahref.

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