锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品亚洲片在线,亚洲国产av玩弄放荡人妇 ,精品久久香蕉国产线看观看亚洲http://www.tkk7.com/SIDNEY/category/6407.htmlzh-cnSat, 21 Jul 2007 19:23:12 GMTSat, 21 Jul 2007 19:23:12 GMT60CheckBoxList 鍜?DropDownList 鐨勪簩綰ц仈鍔?/title><link>http://www.tkk7.com/SIDNEY/archive/2007/07/18/131087.html</link><dc:creator>娓犱笂鏈?/dc:creator><author>娓犱笂鏈?/author><pubDate>Wed, 18 Jul 2007 07:38:00 GMT</pubDate><guid>http://www.tkk7.com/SIDNEY/archive/2007/07/18/131087.html</guid><wfw:comment>http://www.tkk7.com/SIDNEY/comments/131087.html</wfw:comment><comments>http://www.tkk7.com/SIDNEY/archive/2007/07/18/131087.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/SIDNEY/comments/commentRss/131087.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/SIDNEY/services/trackbacks/131087.html</trackback:ping><description><![CDATA[<span style="COLOR: #000000"><</span><span style="COLOR: #000000">script language</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">javascript</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text/javascript</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>    </span><span style="COLOR: #000000"><!--</span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 娣誨姞 CheckBoxList 浜嬩歡</span><span style="COLOR: #008000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000"> addAffair()<br><img id=_134_858_Open_Image onclick="this.style.display='none'; document.getElementById('_134_858_Open_Text').style.display='none'; document.getElementById('_134_858_Closed_Image').style.display='inline'; document.getElementById('_134_858_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=_134_858_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_134_858_Closed_Text').style.display='none'; document.getElementById('_134_858_Open_Image').style.display='inline'; document.getElementById('_134_858_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align=top>        </span><span id=_134_858_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_134_858_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> checkList </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> document.getElementById(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">cblTeamPerson</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> childrens </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> checkList.getElementsByTagName(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">input</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> count </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> childrens.length ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (count </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000"> )<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> checkBox ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> checkBoxid ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000"> ; i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> count ; i </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000"> )<br><img id=_506_836_Open_Image onclick="this.style.display='none'; document.getElementById('_506_836_Open_Text').style.display='none'; document.getElementById('_506_836_Closed_Image').style.display='inline'; document.getElementById('_506_836_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_506_836_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_506_836_Closed_Text').style.display='none'; document.getElementById('_506_836_Open_Image').style.display='inline'; document.getElementById('_506_836_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span id=_506_836_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_506_836_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                checkBoxid </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">cblTeamPerson_</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">+</span><span style="COLOR: #000000"> i ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                checkBox </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> document.getElementById(checkBoxid);                           <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                checkBox.onclick </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">(ev)<br><img id=_715_822_Open_Image onclick="this.style.display='none'; document.getElementById('_715_822_Open_Text').style.display='none'; document.getElementById('_715_822_Closed_Image').style.display='inline'; document.getElementById('_715_822_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_715_822_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_715_822_Closed_Text').style.display='none'; document.getElementById('_715_822_Open_Image').style.display='inline'; document.getElementById('_715_822_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>                </span><span id=_715_822_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_715_822_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                    checkedAffair((ev </span><span style="COLOR: #000000">||</span><span style="COLOR: #000000"> window.event).srcElement  </span><span style="COLOR: #000000">||</span><span style="COLOR: #000000"> ev.currentTarget);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>                }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000">            <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>        <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> 娣誨姞 CheckBox 鐨?nbsp;onclick 浜嬩歡</span><span style="COLOR: #008000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000"> checkedAffair(checkBoxID)<br><img id=_956_1945_Open_Image onclick="this.style.display='none'; document.getElementById('_956_1945_Open_Text').style.display='none'; document.getElementById('_956_1945_Closed_Image').style.display='inline'; document.getElementById('_956_1945_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=_956_1945_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_956_1945_Closed_Text').style.display='none'; document.getElementById('_956_1945_Open_Image').style.display='inline'; document.getElementById('_956_1945_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align=top>        </span><span id=_956_1945_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_956_1945_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> checkBox </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> document.getElementById(checkBoxID.id);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> dropDownList </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> document.getElementById(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ddlTeamLeader</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (checkBox.checked </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">)<br><img id=_1152_1400_Open_Image onclick="this.style.display='none'; document.getElementById('_1152_1400_Open_Text').style.display='none'; document.getElementById('_1152_1400_Closed_Image').style.display='inline'; document.getElementById('_1152_1400_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_1152_1400_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_1152_1400_Closed_Text').style.display='none'; document.getElementById('_1152_1400_Open_Image').style.display='inline'; document.getElementById('_1152_1400_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span id=_1152_1400_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_1152_1400_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> newOption </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> document.createElement(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">OPTION</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                newOption.text </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> getText(checkBox.id) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                newOption.value </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> getValue(checkBox.id) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                dropDownList.options.add(newOption);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (checkBox.checked </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">)<br><img id=_1462_1935_Open_Image onclick="this.style.display='none'; document.getElementById('_1462_1935_Open_Text').style.display='none'; document.getElementById('_1462_1935_Closed_Image').style.display='inline'; document.getElementById('_1462_1935_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_1462_1935_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_1462_1935_Closed_Text').style.display='none'; document.getElementById('_1462_1935_Open_Image').style.display='inline'; document.getElementById('_1462_1935_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span id=_1462_1935_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_1462_1935_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> strValue </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> getValue(checkBox.id) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> count </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> dropDownList.options.length ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> children ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> (</span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> i </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000"> ; i </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> count ; i </span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img id=_1692_1921_Open_Image onclick="this.style.display='none'; document.getElementById('_1692_1921_Open_Text').style.display='none'; document.getElementById('_1692_1921_Closed_Image').style.display='inline'; document.getElementById('_1692_1921_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_1692_1921_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_1692_1921_Closed_Text').style.display='none'; document.getElementById('_1692_1921_Open_Image').style.display='inline'; document.getElementById('_1692_1921_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>                </span><span id=_1692_1921_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_1692_1921_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                    children </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> dropDownList.options[i].value ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                    </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (children </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> strValue)<br><img id=_1823_1903_Open_Image onclick="this.style.display='none'; document.getElementById('_1823_1903_Open_Text').style.display='none'; document.getElementById('_1823_1903_Closed_Image').style.display='inline'; document.getElementById('_1823_1903_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_1823_1903_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_1823_1903_Closed_Text').style.display='none'; document.getElementById('_1823_1903_Open_Image').style.display='inline'; document.getElementById('_1823_1903_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>                    </span><span id=_1823_1903_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_1823_1903_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                        dropDownList.options.remove(i) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>                     }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>                }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>        <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Get the event.onclick Text</span><span style="COLOR: #008000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000"> getText(checkBoxID)<br><img id=_2039_2470_Open_Image onclick="this.style.display='none'; document.getElementById('_2039_2470_Open_Text').style.display='none'; document.getElementById('_2039_2470_Closed_Image').style.display='inline'; document.getElementById('_2039_2470_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=_2039_2470_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_2039_2470_Closed_Text').style.display='none'; document.getElementById('_2039_2470_Open_Image').style.display='inline'; document.getElementById('_2039_2470_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align=top>        </span><span id=_2039_2470_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_2039_2470_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> checkBoxList </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> document.getElementById(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">cblTeamPerson</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> checkbox </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> checkBoxList.getElementsByTagName(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">input</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> index </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> getValue(checkBoxID);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> intIndex </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> parseInt(index);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            alert(checkbox[index].nextSibling.innerHTML);            <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> value </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> checkbox[index].nextSibling.innerHTML ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> value ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>        <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Get the event.onclick Value</span><span style="COLOR: #008000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000"> getValue(checkBoxID)<br><img id=_2566_2924_Open_Image onclick="this.style.display='none'; document.getElementById('_2566_2924_Open_Text').style.display='none'; document.getElementById('_2566_2924_Closed_Image').style.display='inline'; document.getElementById('_2566_2924_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=_2566_2924_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_2566_2924_Closed_Text').style.display='none'; document.getElementById('_2566_2924_Open_Image').style.display='inline'; document.getElementById('_2566_2924_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align=top>        </span><span id=_2566_2924_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_2566_2924_Open_Text><span style="COLOR: #000000">{ <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> checkBox </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> document.getElementById(checkBoxID);<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000"> factLength </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> checkBox.id.length;                   <br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (factLength </span><span style="COLOR: #000000">==</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">15</span><span style="COLOR: #000000">)<br><img id=_2747_2815_Open_Image onclick="this.style.display='none'; document.getElementById('_2747_2815_Open_Text').style.display='none'; document.getElementById('_2747_2815_Closed_Image').style.display='inline'; document.getElementById('_2747_2815_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_2747_2815_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_2747_2815_Closed_Text').style.display='none'; document.getElementById('_2747_2815_Open_Image').style.display='inline'; document.getElementById('_2747_2815_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span id=_2747_2815_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_2747_2815_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> checkBox.id.substring(</span><span style="COLOR: #000000">14</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">15</span><span style="COLOR: #000000">) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>            </span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br><img id=_2846_2914_Open_Image onclick="this.style.display='none'; document.getElementById('_2846_2914_Open_Text').style.display='none'; document.getElementById('_2846_2914_Closed_Image').style.display='inline'; document.getElementById('_2846_2914_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=_2846_2914_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('_2846_2914_Closed_Text').style.display='none'; document.getElementById('_2846_2914_Open_Image').style.display='inline'; document.getElementById('_2846_2914_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align=top>            </span><span id=_2846_2914_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">...</span><span id=_2846_2914_Open_Text><span style="COLOR: #000000">{<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align=top>                </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> checkBox.id.substring(</span><span style="COLOR: #000000">14</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">16</span><span style="COLOR: #000000">) ;<br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>            }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align=top>        }</span></span><span style="COLOR: #000000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">--></span><span style="COLOR: #008000"><br><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">    </span><span style="COLOR: #000000"></</span><span style="COLOR: #000000">script</span><span style="COLOR: #000000">></span> <p> </p> <p>閬囧埌鐨?涓瘮杈冧弗閲嶇殑闂</p> <p>1銆佸湪addAffair錛堬級鏃訛紝欏甸潰鐢熸垚鍚庣粰瀹㈡埛绔敓鎴愮殑鍗曚竴鐨刢heckbox鎸俹nclick浜嬩歡錛屽鏋滅洿鎺ュ啓鎴?/p> <p>checkBox.onclick = checkedAffair錛堬級錛涙槸涓嶅搷搴旂殑錛岃繖鏄湪璋冪敤鍑芥暟錛屽簲璇?/p> <p>checkBox.onclick = function(ev) { 鍑芥暟 }</p> <p> </p> <p>2銆乬etText錛堬級錛屽彇涓嶅埌checkbox鐨凾ext錛孷alue璨屼技紜疄鍙栦笉鍒幫紝鏀圭敤鑾峰彇checkbox鐨凜lientID鐨勫熬鏁版潵璁板綍value鐨勫姙娉曪紝浣嗘槸getElementById錛屽彇鍒扮殑鍙槸“on”錛屽悗鏉ュ張鎯蟲牴鎹甮etElementsByTagName("input")寰楀埌checked鐨刬ndex錛屼絾鏄繑鍥炵殑鍊兼槸undefind錛屽悗鏉ュ張鎯抽氳繃CheckBoxList鐢熸垚鐨?lt;table>錛岀敤DOM妯″瀷鏉ュ彇錛屼緷鐒舵壘涓嶅埌</p> <p>瑙e喅鍔炴硶    var value = checkbox[index].nextSibling.innerHTML;</p> <br><br> <p id=TBPingURL>Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1577056</p> <img src ="http://www.tkk7.com/SIDNEY/aggbug/131087.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/SIDNEY/" target="_blank">娓犱笂鏈?/a> 2007-07-18 15:38 <a href="http://www.tkk7.com/SIDNEY/archive/2007/07/18/131087.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浠ヤ竴涓渶綆鍗曠殑渚嬪瓙鎶奜O鐨凧avaScript璇存槑鐧? 閫夋嫨鑷?yanwp 鐨?Blog http://www.tkk7.com/SIDNEY/archive/2006/03/25/37313.html娓犱笂鏈?/dc:creator>娓犱笂鏈?/author>Sat, 25 Mar 2006 03:16:00 GMThttp://www.tkk7.com/SIDNEY/archive/2006/03/25/37313.htmlhttp://www.tkk7.com/SIDNEY/comments/37313.htmlhttp://www.tkk7.com/SIDNEY/archive/2006/03/25/37313.html#Feedback0http://www.tkk7.com/SIDNEY/comments/commentRss/37313.htmlhttp://www.tkk7.com/SIDNEY/services/trackbacks/37313.html

OO鐨凧avaScript騫朵笉楂樻繁錛岄夯鐑﹀氨楹葷儲鍦╣oogle鍑烘潵鐨勫浗浜轟粙緇嶆枃绔犵粡甯哥綏緗楀棪鍡︼紝鑰屼笖涔嬮棿鐨勮娉曡繕鍚勬湁涓嶅悓錛屾憜鍦ㄤ竴璧峰氨璁╀漢鐪嬩簡澶村ぇ銆?br />榪欓噷閲嶆嬀綆鍗曚富涔夛紝浠ヤ竴涓渶綆鍗曠殑渚嬪瓙鎶奜O Javascript璇存槑鐧姐?/p>

1.涓涓涓虹簿綆鐨勪緥瀛?/strong>

鍙渶鐞嗚В涓変釜鍏抽敭瀛?
絎竴涓槸function 錛孞S涓栫晫閲孋lass鐨勫畾涔夌敤"function"錛宖unction閲岄潰鐨勫唴瀹瑰氨鏄瀯閫犲嚱鏁扮殑鍐呭銆?/p>

絎簩涓槸this鎸囬拡錛屼唬琛ㄨ皟鐢ㄨ繖涓嚱鏁扮殑瀵硅薄銆?/p>

絎笁涓槸prototype錛岀敤瀹冩潵瀹氫箟鎴愬憳鍑芥暟錛?姣旇緝瑙勮寖鍜屼繚闄┿?/p>

//瀹氫箟Circle綾伙紝鎷ユ湁鎴愬憳鍙橀噺r錛屽父閲廝I鍜岃綆楅潰縐殑鎴愬憳鍑芥暟area()
function Circle(radius)
{聽聽
聽 this.r = radius;
}
Circle.PI = 3.14159;
Circle.prototype.area = function(聽 ) {return Circle.PI * this.r * this.r;}
//浣跨敤Circle綾?br />var c = new Circle(1.0);聽聽 
alert(c.area());
鍙﹀鎴愬憳鍑芥暟瀹氫箟榪樺彲浠ュ啓鎴愯繖鏍?
function compute_area(){return Circle.PI * this.r * this.r;}
Circle.prototype.area=compute_area;

2.緇ф壙

娉ㄦ剰涓ょ偣
1.瀹氫箟緇ф壙鍏崇郴 ChildCircle.prototype=new Circle(0); 鍏朵腑0鏄崰浣嶇敤鐨?br />2.璋冪敤鐖剁被鐨勬瀯閫犲嚱鏁奧?br />聽聽聽聽聽this.base=Circle;
聽 聽聽 this.base(radius);

//瀹氫箟ChildCircle瀛愮被
function ChildCircle(radius)
{聽聽
聽聽聽聽 this.base=Circle;
聽 聽聽 this.base(radius);
}

ChildCircle.prototype=new Circle(0);
function Circle_max(a,b)
{
聽聽聽 if (a.r > b.r) return a;

聽聽聽 else return b;
}
ChildCircle.max = Circle_max;
//浣跨敤ChildCircle瀛愮被
var c = new ChildCircle(1);
var聽d = new ChildCircle(2);聽聽
var bigger = d.max(c,d);
alert(bigger.area());

3.var寮忓畾涔?/strong>
JS榪樻敮鎸佷竴縐峷ar Circle={raidus:1.0,PI:3.1415}鐨勫艦寮忥紝璇硶灝卞CSS鐨勫畾涔夈?br />鍥犳濡傛灉Circle鍙湁涓涓疄渚嬶紝涓嬮潰鐨勫畾涔夋柟寮忔洿綆媧侊細

var newCircle=
{
r:1.0,
PI:3.1415,
area: function(){ return this.PI * this.r * this.r;}
};
alert(newCircle.area());
BTW.鍚冮ケ浜嗘拺鐫鍙互鐪嬬湅Rails甯︾殑OO Javascript搴?-Prototype
鍏跺疄錛孞avascript鐜板湪鐨勮娉曠湡鐨勪笉閫傚悎閭d箞鍒壄鐨勫啓鎴怬O妯″紡....


]]>
js 瀛愮獥鍙e拰鐖剁獥鍙f搷浣?/title><link>http://www.tkk7.com/SIDNEY/archive/2006/01/12/27762.html</link><dc:creator>娓犱笂鏈?/dc:creator><author>娓犱笂鏈?/author><pubDate>Thu, 12 Jan 2006 07:18:00 GMT</pubDate><guid>http://www.tkk7.com/SIDNEY/archive/2006/01/12/27762.html</guid><wfw:comment>http://www.tkk7.com/SIDNEY/comments/27762.html</wfw:comment><comments>http://www.tkk7.com/SIDNEY/archive/2006/01/12/27762.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/SIDNEY/comments/commentRss/27762.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/SIDNEY/services/trackbacks/27762.html</trackback:ping><description><![CDATA[<A >http://dev.csdn.net/article/17/17386.shtm</A><img src ="http://www.tkk7.com/SIDNEY/aggbug/27762.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/SIDNEY/" target="_blank">娓犱笂鏈?/a> 2006-01-12 15:18 <a href="http://www.tkk7.com/SIDNEY/archive/2006/01/12/27762.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>js 鏁堥獙http://www.tkk7.com/SIDNEY/archive/2005/12/28/25735.html娓犱笂鏈?/dc:creator>娓犱笂鏈?/author>Wed, 28 Dec 2005 08:02:00 GMThttp://www.tkk7.com/SIDNEY/archive/2005/12/28/25735.htmlhttp://www.tkk7.com/SIDNEY/comments/25735.htmlhttp://www.tkk7.com/SIDNEY/archive/2005/12/28/25735.html#Feedback0http://www.tkk7.com/SIDNEY/comments/commentRss/25735.htmlhttp://www.tkk7.com/SIDNEY/services/trackbacks/25735.html//媯鏌ユ湁鏁堟暟鎹?BR>//浠g爜媯嫻?BR>function isValidCode(stringObj){
  var ret = 1  ;
  if(stringObj.value=="")return ret ;
  var dataPat = /^\S+$/; 
  var matchArray = stringObj.value.match(dataPat);
  if (matchArray == null)     ret = 0;  
  if(!ret){
    alert("璇瘋緭鍏ユ紜殑浠g爜綾誨瀷:[A-Za-z0-9]!");    
  stringObj.focus();
  stringObj.select();
  }
  return ret ;
}

function isValidInteger(integerObj){
  var ret = true  ;
  if(integerObj.value=="")return ret ;
  var dataPat = /^(\d+)(\.?)$/; 
  var matchArray = integerObj.value.match(dataPat);
  if (matchArray == null)     ret = false;  
  if(!ret){
    alert("璇瘋緭鍏ユ紜殑鏁村瀷:([0-9]!");    
  integerObj.focus();
  integerObj.select();
  }
  return ret ;
}

function isValidNumeric(numericObj){
  var ret = 1  ;
  if(numericObj.value=="")return ret ;
  var dataPat = /^(\d+)(\.?)(\d*)$/; 
  var matchArray = numericObj.value.match(dataPat);
  if (matchArray == null)     ret = 0;  
  if(!ret){
    alert("璇瘋緭鍏ユ紜殑鏁板瓧綾誨瀷:(xx*.yy*)!");    
  numericObj.focus();
  numericObj.select();
  }
  return ret ;
 
}
//

//媯鏌ユ湁鏁堟棩鏈?BR>function isValidDate(dateObj){
 
    var ret = 1  ;
 if(dateObj.value=="") return ret ;
    var datePat = /^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/; 
    var matchArray = dateObj.value.match(datePat);
 
    if (matchArray == null)     ret = 0;   
 if(ret){
 //alert(matchArray[1]+'-'+matchArray[3]+'-'+matchArray[5]); 
 
 var d= new Date(matchArray[1], matchArray[3],matchArray[5]);
 // alert(d.getDate()+'aa'+d.getMonth()+'bb'); 
 if(matchArray[3]==12){ 
  matchArray[3] = 0 ;
  matchArray[1] = parseInt(matchArray[1]) + 1;
  }
  
 //if(d.getFullYear()!=matchArray[1]) {ret = 0; alert(matchArray[1]); }
 //if(ret&&(d.getMonth()!=matchArray[3])){ ret = 0; alert(matchArray[3]); }
 //if(ret&&(d.getDate()!=matchArray[5]))  {ret = 0; alert(matchArray[5]);}
 }
 if(!ret){
  alert("璇瘋緭鍏ユ紜殑鏃ユ湡鏍煎紡:(yyyy-mm-dd)!");   
  dateObj.focus();
  dateObj.select();
  return false;
 }
 
 return true ;
}
//鍒ゆ柇鐢ㄦ埛宸茬粡杈撳叆澶氬皯涓瓧絎?BR>function strlength(str){
 var l=str.length;
 var n=l
 for (var i=0;i<l;i++) {
 if (str.charCodeAt(i)<0||str.charCodeAt(i)>255) n++
 }
 return n  
}



]]>
js 琛ㄦ牸鎺掑簭http://www.tkk7.com/SIDNEY/archive/2005/12/28/25722.html娓犱笂鏈?/dc:creator>娓犱笂鏈?/author>Wed, 28 Dec 2005 06:26:00 GMThttp://www.tkk7.com/SIDNEY/archive/2005/12/28/25722.htmlhttp://www.tkk7.com/SIDNEY/comments/25722.htmlhttp://www.tkk7.com/SIDNEY/archive/2005/12/28/25722.html#Feedback0http://www.tkk7.com/SIDNEY/comments/commentRss/25722.htmlhttp://www.tkk7.com/SIDNEY/services/trackbacks/25722.html顥ヮ棩-------------------------------------------
顥ヮ棩
顥ヮ棩var dom = (document.getElementsByTagName) ? true : false;
顥ヮ棩var ie = (document.getElementsByTagName && document.all) ? true : false;
顥ヮ棩var arrowUp, arrowDown;
顥ヮ棩
顥ヮ棩if (ie || dom)
顥ヮ棩 initSortTable();
顥ヮ棩
顥ヮ棩function initSortTable() {
顥ヮ棩 arrowUp = document.createElement("SPAN");
顥ヮ棩 var tn = document.createTextNode("鈻?);
顥ヮ棩 arrowUp.appendChild(tn);
顥ヮ棩 arrowUp.className = "arrow";
顥ヮ棩
顥ヮ棩 arrowDown = document.createElement("SPAN");
顥ヮ棩 var tn = document.createTextNode("鈻?);
顥ヮ棩 arrowDown.appendChild(tn);
顥ヮ棩 arrowDown.className = "arrow";
顥ヮ棩}
顥ヮ棩
顥ヮ棩
顥ヮ棩
顥ヮ棩function sortTable(tableNode, nCol, bDesc, sType) {
顥ヮ棩 var tBody = tableNode.tBodies[0];
顥ヮ棩 var trs = tBody.rows;
顥ヮ棩 var trl= trs.length;
顥ヮ棩 var a = new Array();
顥ヮ棩
顥ヮ棩 for (var i = 0; i < trl; i++) {
顥ヮ棩 a[i] = trs[i];
顥ヮ棩 }
顥ヮ棩
顥ヮ棩 var start = new Date;
顥ヮ棩 window.status = "Sorting data...";
顥ヮ棩 a.sort(compareByColumn(nCol,bDesc,sType));
顥ヮ棩 window.status = "Sorting data done";
顥ヮ棩
顥ヮ棩 for (var i = 0; i < trl; i++) {
顥ヮ棩 tBody.appendChild(a[i]);
顥ヮ棩 window.status = "Updating row " + (i + 1) + " of " + trl +
顥ヮ棩 " (Time spent: " + (new Date - start) + "ms)";
顥ヮ棩 }
顥ヮ棩
顥ヮ棩 // check for onsort
顥ヮ棩 if (typeof tableNode.onsort == "string")
顥ヮ棩 tableNode.onsort = new Function("", tableNode.onsort);
顥ヮ棩 if (typeof tableNode.onsort == "function")
顥ヮ棩 tableNode.onsort();
顥ヮ棩}
顥ヮ棩
顥ヮ棩function CaseInsensitiveString(s) {
顥ヮ棩 return String(s).toUpperCase();
顥ヮ棩}
顥ヮ棩
顥ヮ棩function parseDate(s) {
顥ヮ棩 return Date.parse(s.replace(/\-/g, '/'));
顥ヮ棩}
顥ヮ棩
顥ヮ棩/* alternative to number function
顥ヮ棩 * This one is slower but can handle non numerical characters in
顥ヮ棩 * the string allow strings like the follow (as well as a lot more)
顥ヮ棩 * to be used:
顥ヮ棩 * "1,000,000"
顥ヮ棩 * "1 000 000"
顥ヮ棩 * "100cm"
顥ヮ棩 */
顥ヮ棩
顥ヮ棩function toNumber(s) {
顥ヮ棩 return Number(s.replace(/[^0-9\.]/g, ""));
顥ヮ棩}
顥ヮ棩
顥ヮ棩function compareByColumn(nCol, bDescending, sType) {
顥ヮ棩 var c = nCol;
顥ヮ棩 var d = bDescending;
顥ヮ棩
顥ヮ棩 var fTypeCast = String;
顥ヮ棩
顥ヮ棩 if (sType == "Number")
顥ヮ棩 fTypeCast = Number;
顥ヮ棩 else if (sType == "Date")
顥ヮ棩 fTypeCast = parseDate;
顥ヮ棩 else if (sType == "CaseInsensitiveString")
顥ヮ棩 fTypeCast = CaseInsensitiveString;
顥ヮ棩
顥ヮ棩 return function (n1, n2) {
顥ヮ棩 if (fTypeCast(getInnerText(n1.cells[c])) < fTypeCast(getInnerText(n2.cells[c])))
顥ヮ棩 return d ? -1 : +1;
顥ヮ棩 if (fTypeCast(getInnerText(n1.cells[c])) > fTypeCast(getInnerText(n2.cells[c])))
顥ヮ棩 return d ? +1 : -1;
顥ヮ棩 return 0;
顥ヮ棩 };
顥ヮ棩}
顥ヮ棩
顥ヮ棩function sortColumnWithHold(e) {
顥ヮ棩 // find table element
顥ヮ棩 var el = ie ? e.srcElement : e.target;
顥ヮ棩 var table = getParent(el, "TABLE");
顥ヮ棩
顥ヮ棩 // backup old cursor and onclick
顥ヮ棩 var oldCursor = table.style.cursor;
顥ヮ棩 var oldClick = table.onclick;
顥ヮ棩
顥ヮ棩 // change cursor and onclick
顥ヮ棩 table.style.cursor = "wait";
顥ヮ棩 table.onclick = null;
顥ヮ棩
顥ヮ棩 // the event object is destroyed after this thread but we only need
顥ヮ棩 // the srcElement and/or the target
顥ヮ棩 var fakeEvent = {srcElement : e.srcElement, target : e.target};
顥ヮ棩
顥ヮ棩 // call sortColumn in a new thread to allow the ui thread to be updated
顥ヮ棩 // with the cursor/onclick
顥ヮ棩 window.setTimeout(function () {
顥ヮ棩 sortColumn(fakeEvent);
顥ヮ棩 // once done resore cursor and onclick
顥ヮ棩 table.style.cursor = oldCursor;
顥ヮ棩 table.onclick = oldClick;
顥ヮ棩 }, 100);
顥ヮ棩}
顥ヮ棩
顥ヮ棩function sortColumn(e) {
顥ヮ棩 var tmp = e.target ? e.target : e.srcElement;
顥ヮ棩 var tHeadParent = getParent(tmp, "THEAD");
顥ヮ棩 var el = getParent(tmp, "TD");
顥ヮ棩
顥ヮ棩 if (tHeadParent == null)
顥ヮ棩 return;
顥ヮ棩
顥ヮ棩 if (el != null) {
顥ヮ棩 var p = el.parentNode;
顥ヮ棩 var i;
顥ヮ棩
顥ヮ棩 // typecast to Boolean
顥ヮ棩 el._descending = !Boolean(el._descending);
顥ヮ棩
顥ヮ棩 if (tHeadParent.arrow != null) {
顥ヮ棩 if (tHeadParent.arrow.parentNode != el) {
顥ヮ棩 tHeadParent.arrow.parentNode._descending = null; //reset sort order
顥ヮ棩 }
顥ヮ棩 tHeadParent.arrow.parentNode.removeChild(tHeadParent.arrow);
顥ヮ棩 }
顥ヮ棩
顥ヮ棩 if (el._descending)
顥ヮ棩 tHeadParent.arrow = arrowUp.cloneNode(true);
顥ヮ棩 else
顥ヮ棩 tHeadParent.arrow = arrowDown.cloneNode(true);
顥ヮ棩
顥ヮ棩 el.appendChild(tHeadParent.arrow);
顥ヮ棩
顥ヮ棩
顥ヮ棩
顥ヮ棩 // get the index of the td
顥ヮ棩 var cells = p.cells;
顥ヮ棩 var l = cells.length;
顥ヮ棩 for (i = 0; i < l; i++) {
顥ヮ棩 if (cells[i] == el) break;
顥ヮ棩 }
顥ヮ棩
顥ヮ棩 var table = getParent(el, "TABLE");
顥ヮ棩 // can't fail
顥ヮ棩
顥ヮ棩 sortTable(table,i,el._descending, el.getAttribute("type"));
顥ヮ棩 }
顥ヮ棩}
顥ヮ棩
顥ヮ棩
顥ヮ棩function getInnerText(el) {
顥ヮ棩 if (ie) return el.innerText; //Not needed but it is faster
顥ヮ棩
顥ヮ棩 var str = "";
顥ヮ棩
顥ヮ棩 var cs = el.childNodes;
顥ヮ棩 var l = cs.length;
顥ヮ棩 for (var i = 0; i < l; i++) {
顥ヮ棩 switch (cs[i].nodeType) {
顥ヮ棩 case 1: //ELEMENT_NODE
顥ヮ棩 str += getInnerText(cs[i]);
顥ヮ棩 break;
顥ヮ棩 case 3: //TEXT_NODE
顥ヮ棩 str += cs[i].nodeValue;
顥ヮ棩 break;
顥ヮ棩 }
顥ヮ棩
顥ヮ棩 }
顥ヮ棩
顥ヮ棩 return str;
顥ヮ棩}
顥ヮ棩
顥ヮ棩function getParent(el, pTagName) {
顥ヮ棩 if (el == null) return null;
顥ヮ棩 else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) // Gecko bug, supposed to be uppercase
顥ヮ棩 return el;
顥ヮ棩 else
顥ヮ棩 return getParent(el.parentNode, pTagName);
顥ヮ棩}
顥ヮ棩//-->
顥ヮ棩
顥ヮ棩-------------------------------------------
顥ヮ棩
顥ヮ棩TABLE onclick="sortColumn(event)
顥ヮ棩-------------------------------------------
顥ヮ棩tr 鍔犲叆 THEAD 鏍囩
顥ヮ棩-------------------------------------------
顥ヮ棩鏈夋椂鍊檍s鑳藉疄鐜頒簺寰堝ソ鐨勫姛鑳姐?BR>顥ヮ棩緙虹偣錛氬綋鏈夎礋鏁版椂錛屼笉鑳芥紜帓搴?nbsp;
        鏈夋椂瀹㈡埛绔傚綋鐢ㄤ笅js鍙湁寰堝ソ鐨勬晥鏋?BR>         濡傦細js array
<script language=JavaScript>
 var codes = new Array(new Array(<%= len %>),new Array(<%= len %>),new Array(<%= len %>));
<%
 for(int i=0; i<len; i++)
 {
%>
 codes[0][<%= i %>] = "<%= stocks[i][0] %>";
 codes[1][<%= i %>] = "<%= StringUtil.getUnicode(stocks[i][1]) %>";
 codes[2][<%= i %>] = "<%= stocks[i][2] %>";
<%
 }
%>
</script>
鐢氳嚦鍙啓js綾?

]]>
主站蜘蛛池模板: 免费大学生国产在线观看p| 黄色一级视频免费| 在人线av无码免费高潮喷水| 亚洲国产综合第一精品小说| 8x8x华人永久免费视频| 久久久久久亚洲Av无码精品专口| 最近中文字幕mv免费高清视频8 | 亚洲精品午夜国产va久久| 在线观看特色大片免费视频| 国产成人精品亚洲日本在线| 毛片a级三毛片免费播放| 亚洲 欧洲 日韩 综合在线| 日本不卡高清中文字幕免费| 国产精品亚洲专区在线播放 | 精品熟女少妇aⅴ免费久久| 久久99亚洲综合精品首页| 99精品视频在线观看免费| 日韩亚洲一区二区三区| 免费无码成人AV在线播放不卡| 亚洲精品视频免费在线观看| 国产成人免费高清激情明星| 亚洲永久在线观看| 国产精品冒白浆免费视频| 无码精品人妻一区二区三区免费| 亚洲综合色视频在线观看| 光棍天堂免费手机观看在线观看 | 三年片免费高清版 | 亚洲黄色在线观看视频| 久久久久久免费视频| 亚洲精品自偷自拍无码| 亚洲 国产 图片| 中文字幕在线免费视频| 亚洲天堂男人天堂| 噼里啪啦电影在线观看免费高清| 亚洲av乱码一区二区三区按摩| 亚洲一区二区三区免费| 久久这里只精品国产免费10| 亚洲乱码中文论理电影| 国产成人啪精品视频免费网| a级毛片免费高清视频| 久久亚洲私人国产精品|