新人求助,在servl下的alert使用
写了一段
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws
ServletException,
IOException {
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
HttpSession session=request.getSession();
Long points=Long.parseLong(request.getParameter("points"));
Tbluser tbluser=(Tbluser) session.getAttribute("user");
UserDao userDao=new UserDao();
if(points<50){
out.print({out.print("<script> alert('请确认您的账号密码!'); </script>"););
}else{
points=points-50;
tbluser.setPoints(points);
userDao.update(tbluser);
out.print(points);
out.close();
}
但是不单框,跪求解答
}
------解决方案--------------------
var result = xmlHttp.responseText;
if(result xxx){
alert('请确认您的账号密码!');
}