var params = JSON.stringify({“username”:“wei”, “password”:“toor”})
KaTeX parse error: Expected '}', got 'EOF' at end of input: …'post', url:'{pageContext.request.contextPath }/myjson/jsonsource.do’,
contentType:‘application/json;charset=utf-8’,
data:params,
dataType:‘json’,//后台返回数据
success:function(data){
alert(data.username)
alert(data.password)
},
error:function(textStatus,errorThrown){
alert(textStatus)
}
})
ajax发送数据
最新推荐文章于 2024-07-21 22:36:34 发布