1 Ajax简介
1 ajax概念
2 什么是同步?什么是异步?
3 ajax原理
2 JavaScript原生的ajax
1 ajax.html代码
Insert title here
2 AjaxServlet代码
package www.test.ajax01;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;public class AjaxServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //response.getWriter().write("zhangsan"); /*try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); }*/ String parameter = request.getParameter("name"); response.getWriter().write(Math.random()+parameter); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); }}
3 注意事项
4 ajax图解