开发者

jQuery.ajax success function not executed in win xp

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜