javascript 实现数据表格显示的展开与折叠
<script language="javascript">
function ShowTableRow(id)
{
var _Row = document.getElementById(id) <!-- 获取ID为TableRowID 的对象 -->
var _Img = document.getElementById("Img"+id)
<!--alert(_Img)-->
if(_Row.style.display=="none")
{
_Row.style.display="";
_Img.src="arrowUP.gif";
}
else
{
_Row.style.display="none";
_Img.src="arrowDOWN.gif";
}
}
</script>
*******************************
asp/jsp 页面: 设置对象的 ID
.......................
<td width="14%" bgcolor="#ecfaff" ><div align="center"><img src="arrowDOWN.gif" id="Img<%=num%>" onClick="ShowTableRow(<%=num%>)"></div></td>
<td width="12%" bgcolor="#ecfaff" class="style11"></td>
</tr>
<!------ 展开/折叠***** 行-- 出厂流向 -->
<tr class="style11" bgcolor="#66CC99">
<td colspan="7">
<div id=<%=num%> style="display:none" >
<table width="73%" border="0" align="center" cellpadding="0" cellspacing="1" >
<%
'-- 根据RS1结果,动态画表格
sql1="SELECT ORG_CODE,ORG_NAME, count(*) as OUTNUM1 from "
sql1=sql1+" ciginfo where substring(barcode,3,6)='"+ppdm+"' and
相关文档:
JavaScript以ECMAScript标准作为功能基准,ECMAScript有5种原型类型:Undefined,Null,Boolean,Number和String。
可以用typeof来判断类型,例:
var sTemp = "test string";
alert(typeof sTem ......
ECMAScript中,switch语句可以用于字符串,而且能用不是常量的值说明情况:
var BLUE="blue" , RED = "red" , GREEN = "green";
switch(sColor)
{
case BLUE: alert("Blue"); break;
&nb ......
delete只能删除开发者定义的属性或方法,原始的ECMAScript方法不能删除,因为不是开发者定义的,比如:toString()。
var o = new Object;
o.name = "Nicholas";
delete o.name;
&n ......
闭包:
ECMAScript支持闭包。所谓闭包,就是函数能使用函数外定义的变量。
var iBaseNum = 10;
function addNumbers(iNum1, iNum2)
{
function doAddition()
......
按钮式:
<INPUT name="pclog" type="button" value="/GO" onClick="location.href='http://game.unimagic.cn'">
链接式:
<a href="javascript:history.go(-1)">返回上一步</a>
<a href="<%=Request.ServerVariables("HTTP_REFERER")%>">返回上一步</a>
直接跳转式:
<scrip ......