.save()
我从函数中得到错误响应。服务器端 php 向我返回一个文本并成功将 url 保存到数据库中。当我检查响应时,我可以看到 PHP 返回的文本,但是我不明白为什么它会出现错误回调。可能是什么原因?
urlToAdd.save({}, {
success: function () {
console.log("In here");
},
error: function (model, response) {
console.log(model.toJSON());
console.log(response);
console.log("Not in here");
}
});
服务器响应:
HTTP/1.1 200 OK
Date: Sat, 19 May 2012 21:31:27 GMT
Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6
X-Powered-By: PHP/5.3.6
Content-Length: 96
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
X-Pad: avoid browser bug