使用getJSON()异步请求服务器返回json格式数据的实现
我们可以使用jquery的getJSON()方法请求服务器返回json格式数据: js代码: function test(){ $.getJSON("JsonServlet",function(result){ alert(result.name); }); } 服务器端servlet响应: @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
下载地址
用户评论