ajax post响应statusCode函数未被调用

时间:2013-05-21 19:43:40

标签: jquery ajax post

即时通讯使用此ajax方法由于某种原因,提交后从服务器返回的状态代码被忽略..

这是我在响应中从服务器中恢复的内容

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 4241

方法:

function submitForm() {
    $.ajax({
        url : jQuery("#contact-form").attr("action"),
        type : jQuery("#contact-form").attr("method"),
        data : jQuery("#contact-form").serialize(),
        statusCode : {
            200 : (function() {
                alert("yyyyyyyyaaaaaaaaaaaaa");
            }),
    400 : (function() {
                alert("eeeerrrrrrrrrr");
            })
        }
    });
}

0 个答案:

没有答案