jquery代码:
$(function(){
var id = ${cus.id};
if(id != null && id != ""){
$.ajax({
url: "/Cus/Personal.do?id="+id,
type : "post",
dataType : "json",
success: function (data) {
$("ye").html("¥"+data.money);
$("jkb").html(data.healthycoin+"个");
}
});
}
})
control:
@RequestMapping("/personal.do")
public void personal(int id){
Customer customer=cusService.get(id);
response.setCharacterEncoding("utf-8");
Gson gson = new Gson();
try {
response.getWriter().print(gson.toJson(customer));
} catch (IOException e) {
e.printStackTrace();
}
}
AJAX 后台 传参
最新推荐文章于 2024-04-28 04:09:01 发布