I want to prevent a function to execute before get a value from ajax, I'm trying using async:false it works but deprecated. So, I'm using callback like what I found on internet. It's works too, but the browser still tell me if the callback is not the function. Here's my code
function User() {
this.nama;
this.nis;
this.pass;
this.role;
this.url = "http://localhost/elearning-web/";
this.Login = function(call) {
$.ajax({
type:"POST",url:this.url+"dologin.php",data:"nis="+this.nis+"&pass="+this.pass,
success:function(e){
call(e);
}
});
}
}
When I check the console.log it's show what I want to display, but the browser tell me if the call (callback) is not a function. Thanks in advance
</div>