jQuery ajax post在Node + Express的JSON响应上生成“Unexpected token:”

jQuery ajax post在Node + Express的JSON响应上产生一个错误“Unexpected token:[newline]”:

SyntaxError {stack: "SyntaxError: Unexpected token :↵ at eval (nativ…st:3000/javascripts/jquery-1.10.1.min.js:6:18626)", message: "Unexpected token :"} 

在服务器上:

 app.post('/api/sav', function(req, res, next) { var result = {"status": "success"}; res.send(JSON.stringify(result)) // this works //res.type('json'); // this has no effect //res.type('application/json'); // this has no effect //res.send(result); // this fails but should work, no? //res.json(result); // this fails but should work, no? }); 

并在客户端

 $.ajax({ type: "POST", url: '/api/sav', data: content, success: function(data, textStatus, jqXhr) { console.log(data); }, error: function(jqXHR, textStatus,errorThrown ) { console.log(textStatus); console.log(errorThrown); }, dataType: 'json' }); 

服务器响应在每种情况下似乎都是相同的 在这里输入图像描述

在过去,我已经能够使用res.send(object) ,没有显式的string化。 想不到任何我忘了在这里设置的express.js设置。

语法错误:意外的标记<