document.getElementById 取不到值!空白页测试可以
博彩导航网站排行榜
博彩导航网站排行榜
当前位置 : 博彩导航网站排行榜 > 博彩导航网站排行榜

document.getElementById 取不到值!空白页测试可以

<!-- 工单管理    我的工单 -->
<%@ page language="java" import="java.util.*,com.qdzq.zqbp.entity.*,com.qdzq.zzpt.vo.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath;
String basePath = request.getScheme+"://"+request.getServerName+":"+request.getServerPort+path+"/";
//Page<sys_role> p = Page<sys_role>request.getAttribute"page";
Page<zqbp_gdgl> p = Page<zqbp_gdgl> request.getAttribute"page";

String user = Stringsession.getAttribute"user"; 
%>

<script language="javascript" type="text/javascript">

            //转换器,将列的字段类型转换为可以排序的类型:String,int,float
            function convertsValue, sDataType {            //值,类型int ,date ,float,String
                switchsDataType {   //选择类型
                    case "int":
                        return parseIntsValue;   //返回int型
                    case "float":
                        return parseFloatsValue;   //返回float型
                    case "date":
                        return new DateDate.parsesValue;  //返回date型(日期)
                    default:
                        return sValue.toString;   //转换为字符串
                
                }
            }
            
            //排序函数产生器,iCol表示列索引,sDataType表示该列的数据类型
            function generateCompareTRsiCol, sDataType {    //类型索引,类型
        
                return  function compareTRsoTR1, oTR2 {
                            var vValue1 = convertoTR1.cells[iCol].firstChild.nodeValue, sDataType;
                            var vValue2 = convertoTR2.cells[iCol].firstChild.nodeValue, sDataType;
        
                            if vValue1 > vValue2 {
                                return -1;
                            } else if vValue1 < vValue2 {
                                return 1;
                            } else {
                                return 0;
                            }
                        };
            }
            
            //排序方法
            function sortTablesTableID, iCol, sDataType {
                
                var oTable =document.getElementByIdsTableID;
                   alertoTable;//就是这里!!!!!!!!!!!!!!!!!!!!!!!!弹出null
                ifoTable.rows.length<2{
                   
                alert"无数据";
                return false;
                }
                var oTBody = oTable.tBodies[0];
                
                var colDataRows = oTBody.rows;
                var aTRs = new Array;
                
                //将所有列放入数组
                for var i=0; i < colDataRows.length; i++ {
                    aTRs[i] = colDataRows[i];
                }
                 
                //判断最后一次排序的列是否与现在要进行排序的列相同,是的话,直接使用reverse逆序
                if oTable.sortCol == iCol {
                    aTRs.reverse;
                } else {
                    //使用数组的sort方法,传进排序函数
                    aTRs.sortgenerateCompareTRsiCol, sDataType;
                }
        
                var oFragment = document.createDocumentFragment;
                for var i=0; i < aTRs.length; i++ {
                    oFragment.appendChildaTRs[i];
                }
 
                oTBody.appendChildoFragment;
                //记录最后一次排序的列索引
                oTable.sortCol = iCol;
            }
            
            
        
        

        </script>

<div class="pageHeader">
    <form id="pagerForm" onsubmit="return navTabSearchthis;"
        action="<%=basePath %>admin/gdgl/index1.html?name=<%=user%>" method="post">
        <div class="searchBar">
            <table class="searchContent">
              <tr>
                <td>
                    客户
                </td>
                <td >
                    <input type="text" class="floatLeft" value="" name="id" maxlength="50"/>
                </td>
                <td><div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
                </ul>
            </div></td>
              </tr>
            </table>
            
        </div>
        <input type="hidden" name="page" value="<%=p.getPage%>" /><!--【必须】value=1可以写死-->
      <input type="hidden" name="rows" value="<%=p.getRows %>" />
    </form>
    
</div>




<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
        
            <li><a class="add" href="<%=basePath %>admin/gdgl/add1.html"
                target="navTab" ><span>新增</span>
            </a>
            </li>
             <li>
            
            <a class="edit" href="<%=basePath %>admin/gdgl/edit01.html?id={field_id}"
                target="navTab" 
                warn="请选择数据"><span>编辑</span>
            </a>
            </li>
        
        </ul>
    </div>

    <table class="table" width="1100" layoutH="108" rel="custom" id="tblSort">
        <thead>
            <tr>
                <th width="100" onClick="sortTabletblSort,0,int"  >工单号</th>
                <th width="100">客户</th>
                <th width="70">时间</th>
                <th width="100">问题描述</th>
                <th width="75">附件</th>
                <th width="75">维护时间</th>
                <th width="75">状态</th>

            </tr>
        </thead>
        <tbody>
        <%
            for zqbp_gdgl one : p.getList {
        %>
            <tr target="field_id" rel="<%=one.getId%>">
                
                <td><%=one.getGdNum == null ? "" : one.getGdNum %></td>
                
                <td><%=one.getGdCreateUser == null ? "" : one.getGdCreateUser%></td>
            
                <td><%=one.getGdCreateTime == null ? "" : one.getGdCreateTime %></td>
                
                <td><%=one.getGdContent == null ? "" : one.getGdContent %></td>
                <td><%=one.getGdFjFilename == null ? "" : one.getGdFjFilename %></td>
                
                <td><%=one.getGdDate == null ? "" : one.getGdDate %></td>
                
                <%
                ifone.getGdStatus==0 {
                %>
                <td>未提交</td>
                <%
                    }
                %>
                <%
                ifone.getGdStatus==1 {
                %>
                <td>已提交</td>
                <%
                    }
                %>
                <%
                ifone.getGdStatus==2 {
                %>
                <td>已处理</td>
                <%
                    }
                %>
                
            </tr>
            <%
                }
            %>
        
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
   <span>显示</span>
   <select class="combox" name="numPerPage" onchange="navTabPageBreak{numPerPage:this.value}">
                <option value="20">20</option>
            </select>
   <span>条,共<%=p.getTotalCount %>条</span>
  </div>
  <!--分页组件-->
  <div class="pagination" targetType="navTab" totalCount="<%=p.getTotalCount%>" numPerPage="<%=p.getRows %>" pageNumShown="<%=p.getPageCount%>" currentPage="<%=p.getPage%>"></div>
        
    </div>
    </div>

js代码放在 </body> 前面

你js执行时下面DOM都没加载,当然取不到咯

从上往下加载,你js执行的时候,你要操作的dom还没生成呢,当然没有了

最好放在 domready 里边

最新文章

广告位

博彩导航网站排行榜