$.ajax({url:"http://127.0.0.1:3000/test",data:{"hello":"abc"}},function(d){alert(d)});
});
我用ajax发一个data,然后用express这么写:
//.../routes.js
exports.test = function(req,res){
console.log(req.query);
res.send(200,'hello world:\n'+req.query);
}
在服务器端看到
{ hello: 'abc' }
GET /test?hello=abc 200 1ms - 28b
但是在客户端就没有 hello world出现 这是为什么
回复 (4)
J
jQuery API先搞懂
D
G
用ajax请求会发生什么
G
@thesadboy 当我问了一个白痴的问题吧…………
参与回复
登录后即可参与回复。登录