简体   繁体   English

jQuery.ajax成功函数未在Win XP中执行

[英]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 顺便说一下,我用cakephp和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. 您可以在beforeSend之前使用ss 删除那些,它应该可以工作。 I found the error in one second after giving it a quick check on JSLint . 在对JSLint进行快速检查之后,我在一秒钟内发现了错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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