AJAX应该如何发送请求
程序开发
2023-09-05 07:58:27
XMLHttpRequest对象
XMLHttpRequest对象的方法
AJAX GET请求
@WebServlet("/ajaxRequest")
public class AjaxRequestServlet extends HttpServlet {@Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {PrintWriter out = response.getWriter();//XMLHttpRequest对象获取输出信息out.print("welcome to study ajax");}
}