javascript - Ajax call does not work properly -
i have written code authentication.it works till calling of function "a", control goes function ignores redirect line..i checked using alert executes "a" function. why happening?
$('#loginbtn').click(function() { var username = document.getelementbyid('uid').value; var password = document.getelementbyid('pwd').value; $.ajax({ type : "post", url : "/loginnew.aspx/authenticate", data : { username: username , password: password }, async : false, contenttype : "application/json; charset=utf-8", datatype : "json", success : a, error : function(e) { alert(e.valueof()); } }); function a() { window.location.href = "login.aspx"; } });
success : a() //function called
try using
success : function(){window.location.href = "login.aspx"};
Comments
Post a Comment