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
相关文档:
ECMAScript有无用存储单元收集程序,当在再没有对对象的引用时,称该对象被废除(dereference)了。
运行无用存储单元收集程序时,所有废除的对象都被销毁。
把对象的所有引用都设置为null,可以强制性的废除对象,例如:
var oObject = new Object;
.......
&n ......
JavaScript以ECMAScript标准作为功能基准,ECMAScript有5种原型类型:Undefined,Null,Boolean,Number和String。
可以用typeof来判断类型,例:
var sTemp = "test string";
alert(typeof sTem ......
用于枚举对象的属性
例:
for(sProp in window)
{
alert(sProp); //显示BOM window对象的所有属性。
}& ......
with语句
用于设置代码特定对象的作用域。
例:
var sMessage = "hello world";
with(sMessage)
{
&nbs ......