简体   繁体   中英

jQuery.ajax success function not executed in win xp

Code:

$.ajax({
    type: "POST",
    url: "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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM