不显示alert通常为:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
用户登录
function userLogin(){
var userName=document.getElementById("username");
var password=document.getElementById("password");
if(userName.value == "" && userName.value.length<5){
alert("请输入用户名!")
userName.focus();
return false;
}else if(password.value == "" && password.value.length<5){
alert("请输入用户密码!");
password.focus();
return false;
}else{
return true;
}
}
function userReg(){
document.frmAction.action="user_add.jsp";
document.frmAction.submit();
}
我帮你改了下,你看看能不能用alert了....
alert();是不是卸载function中,有没有分号结束