小编Ste*_*fan的帖子

如何正确处理httpStatuscode

我想用新功能(http://api.jquery.com/jQuery.ajax)对http状态代码(如200,201或202)作出反应.但该功能忽略了我的201和202回调.

firefox-4.0_b10和chromium-9.0会出现此错误

我期待着解决这个小问题.

关心斯特凡

我的代码剪了:

jQuery.ajax({
        url: url,
        dataType: 'json',
        statusCode: {
          404:function() { alert("404"); },
          200:function() { alert("200"); },
          201:function() { alert("201"); },
          202:function() { alert("202"); }
        },
        success: function(data){
          switch(data.status) {
            case 'done':
              /* display it to the User */
              break;
          }
        });

ajax jquery http-status-codes jquery-1.5

5
推荐指数
1
解决办法
2308
查看次数

标签 统计

ajax ×1

http-status-codes ×1

jquery ×1

jquery-1.5 ×1