52,797
社区成员
发帖
与我相关
我的任务
分享
resp.setContentType("text/html");// text/javascript||application/json
resp.setCharacterEncoding("utf-8");
if(req.getParameter("asyn")!=null){
System.out.println("[MCM]build channel jump asynchor servlet");
req.getRequestDispatcher("/channel/build/ajax").forward(req, resp);
}
<script type="text/javascript">
function gotClick(){
$.post("../ajax/test.htm",{ajaxField:12},function(data){
alert(1);
},"json");
}
</script>
2.调试ajax,最好用chome或firefox打开开发者控制台中的xhr。