Code:
$.ajax({
type: "POST",
u开发者_运维技巧rl: "students/login",
data:{"data[Student][email]":_email,"data[Student][password]":_password},ss
beforeSend: function(){
$("#confirm").text("");
},
error: function (xhr, status) {
alert(status);
},
success: function(msg){
if(msg == " success"){
$("#confirm").text("Log in, please wait .......");
} else {
$("#confirm").text("No such user or password is incorrect!");
}
}
});
by the way,I do it with cakephp and jquery
Is that because of this? One extra space before the success, or just the format is wrong...
if(msg == " success")
You have ss right before beforeSend: Remove those and it should work. I found the error in one second after giving it a quick check on JSLint.
精彩评论