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
相关文档:
1.asp.net呼叫js
view
plain
copy
to clipboard
print
?
Response.Write("<mce:script language=javascript><!--
");
Response.Write("alert('欢迎您 ');"
);
Response.Write("location.href='login.aspx';"
)& ......
ASP.NET中前台javascript与后台代码调用
2010-03-31 10:01
.net中C#代码与javaScript函数的相互调用问题。
问:
1.如何在JavaScript访问C#函数?
2.如何在JavaScript访问C#变量?
3.如何在C#中访问JavaScript的已有变量?
4.如何在C#中访问JavaScript函数?
问题1答案如下:
javaScript函 ......
//String.prototype使用
//批量替换,比如:str.ReplaceAll([/a/g,/b/g,/c/g],["aaa","bbb","ccc"])
String.prototype.ReplaceAll=function (A,B) {
var C=this;
for(var i ......
with语句
用于设置代码特定对象的作用域。
例:
var sMessage = "hello world";
with(sMessage)
{
&nbs ......
函数
即使函数确实有返回值,也不必明确地声明它。该函数只需要使用return运算符后跟要返回的值即可。
例:
function sum(iNum1, iNum2)
{
  ......