CNode

post数据以后页面没有刷新

Gggaaooppeenngg发布于13 年前最后回复13 年前8 回复5677 浏览0 收藏
$.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
JacksonTian#1·13 年前

jQuery API先搞懂

G
ggaaooppeenngg#3·13 年前

用ajax请求会发生什么

G
ggaaooppeenngg#4·13 年前

@thesadboy 当我问了一个白痴的问题吧…………

参与回复
登录后即可参与回复。登录