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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -