当前位置: 代码迷 >> Ajax >> 为啥 运行到这里时document.getElementById("indicator").style.display="block"显示是缺少对象的 ?
  详细解决方案

为啥 运行到这里时document.getElementById("indicator").style.display="block"显示是缺少对象的 ?

热度:1199   发布时间:2013-01-11 11:57:35.0
为什么 运行到这里时document.getElementById("indicator").style.display="block";显示是缺少对象的 ??
本帖最后由 showbo 于 2012-10-24 21:19:18 编辑
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC"-//W3C//DTC HTML 4.01 Transitional//EN">
<html>
<head>
          <script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
          <script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
          <script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
        
          <script language="javascript">
          function check1()
          {
               if(document.ThisForm.userName.value=="")
               {
                    alert("请输入用户名");
                    document.ThisForm.userName.focus();
                    return false;
               }
               if(document.ThisForm.userPw.value="")
               {
                alert("请输入密码");
                return false;
                }
                document.getElementById("indicator").style.display="block";
                loginService.login(document.ThisForm.userName.value,document.ThisForm.userPw.value,0,callback);
                }
                function callback(data)
                {
                     document.getElementById("indicator").style.display="none";
                 if(data=="no")
                {
                     alert("用户名或密码错误");
                }
  相关解决方案