0

当我这样做时:

Comments.create(dat, {
                wait:true,
                success:function(){
                    main_alert('Posted successfully', 'success', 3000);
                },
                error:function(????){
                    main_alert('Error posting', 'error', 'default');
                }
            });

每当我发现后端有问题时,我希望我的服务器返回一个“错误”。目前,只要创建完成,我的服务器就会返回一个 JSON。我的服务器如何返回错误?错误参数是什么?

4

1 回答 1

0

successerror接收的参数是(model, response, options)是参考。下面response有一个属性responseText,其中包含从服务器接收到的文本。

于 2013-11-15T12:36:10.390 回答