文件名称:在线考试系统案例
文件大小:5.75MB
文件格式:RAR
更新时间:2021-04-02 08:50:39
在线考试系统
<head> <base href="<%=basePath%>"> <title>在线考试信息系统</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> </head> [removed] function _reset() { document.getElementById("usName").value = ""; document.getElementById("usPassword").value = ""; document.getElementById("msg").value = ""; document.getElementById("yzmvl").value = ""; document.getElementById("isOkMsg").src = "<%=basePath%>/images/nos.png"; document.getElementById("usName").focus(); document.getElementById("login_ok").removeAttribute("disabled"); } function _init() { document.getElementById("usName").focus(); document.getElementById("yzmvl").value = ""; } var xmlRequest; function _change(value) { //创建XMLHttpRequest对象 //判断浏览器兼容性问题 在JSP中null可以当false使用 if(window.XMLHttpRequest) { //非IE浏览器 xmlRequest = new XMLHttpRequest(); } else { //IE浏览器 xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); } //设置回滚函数 xmlRequest.onreadystatechange = _callBack; //设置请求连接 xmlRequest.open("post", "randomCode?valueCod=" + value, true); //发送请求 xmlRequest.send(null); } //回滚函数 在请求的服务执行完毕后 主动调用 var vlCod; function _callBack() { //1.建立连接 请求信息发送完毕 服务器响应完毕 //readyState == 4 ------->服务器响应完毕 if(xmlRequest.readyState == 4) { //status == 200 表示服务器执行成功 如不成功:404 405 500 if(xmlRequest.status == 200) { vlCod = xmlRequest.responseText; if(vlCod == "1") { document.getElementById("isOkMsg").src = "<%=basePath%>/images/yes.png"; document.getElementById("login_ok").removeAttribute("disabled"); } else { document.getElementById("isOkMsg").src = "<%=basePath%>/images/NO.png"; document.getElementById("msg").value = "对不起!验证码错误。"; document.getElementById("login_ok").setAttribute("disabled", "disabled"); } } } } function _sub() { var usName = document.getElementById("usName").value; var usPassword = document.getElementById("usPassword").value; var yzmvl = document.getElementById("yzmvl").value; if(usName == null || usName == "") { document.getElementById("msg").value ="对不起!用户名不能为空。"; document.getElementById("usName").focus(); return false; } if(usPassword == null || usPassword == "") { document.getElementById("msg").value ="对不起!密码不能为空。"; document.getElementById("usPassword").focus(); return false; } if(yzmvl == null || yzmvl == "") { document.getElementById("msg").value ="对不起!验证码不能为空。"; document.getElementById("yzmvl").focus(); return false; } if(vlCod != 1 || vlCod !="1") { document.getElementById("msg").value =""; return false; } return true; } function changeCode() { document.getElementById("yzm").src = "randomCode"; } [removed]