JavaScriptʵÏÖGridViewÏàͬÐеĺϲ¢
ÏÈ¿´Ð§¹û£¬ºÏ²¢Ç°£º
ºÏ²¢ºó£º
ʵÏÖÔ´Â룺
// ******************************
//¹¦ÄÜ£ºÓû§ºÏ²¢GridViewÏàͬµÄÐÐ(ǰ̨ÏÔʾµÄʱºòºÏ²¢)
//ʱ¼ä£º2009/08/12 14:59
//×÷ÕߣºYzy
// ******************************
//²ÎÊý˵Ã÷£ºstrGridId—Êý¾Ý¿Ø¼þÃû³Æ£»arrIndexCol—²»Çå³þ£»arrMergeCol—ÒªºÏ²¢µÄÁÐË÷Òý(´Ó0¿ªÊ¼)£»
// blHasHeader—±íÍ·ÊÇ·ñ²ÎÓëºÏ²¢£»blHasFooter—±í½ÅÊÇ·ñ²ÎÓëºÏ²¢£»blHasPageLine—ÊÇ·ñ±£Áô×îºóÒ»ÐÐÊý¾Ý²»²ÎÓëºÏ²¢
function fcnAthosColumnMerge(strGridId, arrIndexCol, arrMergeCol, blHasHeader, blHasFooter, blHasPageLine)
{
var tbl = document.all[strGridId];
var iH = 0;
var iF = 0;
if(blHasHeader == true) iH++;
if(blHasFooter == true) iF++;
if(blHasPageLine == true) iF++;
tRows = tbl.children[0].children;
i0 = iH;
strKey = new Array(arrIndexCol.length);
strPrevKey = new Array(arrIndexCol.length);
for(ii=0; ii<arrIndexCol.length;ii++)
{
strKey[ii] = tRows[iH].children[arrIndexCol[ii]].innerText;
strPrevKey[ii] = strKey[ii];
}
for(i=iH+1;i<tRows.length-iF;i++)
{
blEqual = true;
for(ii=0; ii<arrIndexCol.length;ii++)
{
strKey[ii] = tRows[i].children[arrIndexCol[ii]].innerText;
if(strKey[ii] != strPrevKey[ii])
blEqual = false;
}
if(blEqual == false)
{
for(ii=0;ii<arrMergeCol.length;ii++)
tRows[i0].children[arrMergeCol[ii]].rowSpan = i-i0;
for( j=i0+1; j<i; j++)
for(ii=arrMergeCol.length-1;ii>=0;ii--)
tRows[j].children[arrMergeCol[ii]].removeNode(true);
i0 = i;
for(ii=0;ii<strKey.length;ii++)
strPrevKey[ii] = strKey[ii];
}
}
for(ii=0;ii<arrMergeCol.length;ii++)
tRows[i0].children[arrMergeCol[ii]].rowSpan = i-i0;
for( j=i0+1; j<i; j++)
for(ii=arrMergeCol.length-1;ii>=0;ii--)
tRows[j].children[arrMergeCol[ii]].removeNode(true);
return;
}
//º¯Êýµ÷ÓÃDemo£¨ºÏ
Ïà¹ØÎĵµ£º
Summary ×ܽá
When web pages or applications begin to feel slow, analyzing assets as they come over the wire and profiling scripts while they are running allows you to focus your optimization efforts where they are needed most.
µ±ÍøÒ³»òÓ¦ÓóÌÐò±äÂýʱ£¬·ÖÎ ......
1 history.go(0)
2 location.reload() £¨Ò³Ãæ½øÐÐˢУ¬µ«ÎªdisabledµÄÔªËØµÄÖµ²»»á±»Çå¿Õ£©
3 location=location
4 location.assign(location)
5 location.replace(location)
6 from..reset() (Ò³Ãæ²»½øÐÐˢУ¬Ä£Äâµ¥»÷¶ÔËùµ÷ÓÃ±íµ¥ÖØÖð´Å¥µÄµ¥»÷)
......
ÔÎijö´¦: http://www.dnew.cn/post/196.htm
ÏÈ¿´ÏÂÏÂÃæ¼¸ÖÖд·¨
1.function f(x){return x*x;};f(x);
2.(function(x){return x*x;})(x);
3.(function(x){return x*x;}(x));
µÚÒ»ÖÖÎÒÃÇÓ¦¸Ã¶¼ºÜÊìϤÁË£¬ÕâÊÇÎÒÃǾ³£Ê¹ÓõÄд·¨¡£µÚ¶þµÚÈýÖÖ¶¼ÊÇÄäÃûº¯ÊýµÄд·¨¡£
------------------------------------------------ ......
³ýÁËÓÃgetElementByTagName µÄÁíÒ»ÖÖ»ñÈ¡¶ÔÏ󼯺ϵķ½·¨
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" conte ......