﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-ZeroLine-随笔分类-JavaScript</title><link>http://www.blogjava.net/zeroline/category/47008.html</link><description>All things are difficult before they are easy.</description><language>zh-cn</language><lastBuildDate>Sun, 19 Dec 2010 05:18:22 GMT</lastBuildDate><pubDate>Sun, 19 Dec 2010 05:18:22 GMT</pubDate><ttl>60</ttl><item><title>javascript 触发事件列表 </title><link>http://www.blogjava.net/zeroline/archive/2010/12/19/341087.html</link><dc:creator>zeroline</dc:creator><author>zeroline</author><pubDate>Sun, 19 Dec 2010 02:31:00 GMT</pubDate><guid>http://www.blogjava.net/zeroline/archive/2010/12/19/341087.html</guid><wfw:comment>http://www.blogjava.net/zeroline/comments/341087.html</wfw:comment><comments>http://www.blogjava.net/zeroline/archive/2010/12/19/341087.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zeroline/comments/commentRss/341087.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zeroline/services/trackbacks/341087.html</trackback:ping><description><![CDATA[<div class="postbody" style="font-family: Courier">1.单击事件___onclick<br />
用户单击鼠标按键时产生的事件.同时onclick指定的事件处理程序或代码将被调用执行.<br />
如:&lt;input type="button" value="打开页面" onlick="window.open('xxxx.html','newwindow','width=456,height=230,toolbar=no,menubar=no,scrollbars=yes');"&gt;<br />
&nbsp;<br />
2.改变事件___onchange<br />
当text或textarea元素内的字符值改变或select表格选项状态改变里发生该事件.<br />
如;&lt;textarea name="liuyan" rows=5 cols=70 value=" " onchange=alert("您在文本框中添加了新的内容")&gt;<br />
&nbsp;<br />
3.选中事件____onselect<br />
当text或textarea对象中的文字被选中里会引发该事件<br />
如:&lt;ipnut type="text" value="默认信息" onselect=alert("您选中了文本框中的文字")&gt;<br />
&nbsp;<br />
4.获得焦点事件____onfocus<br />
用户单击text或textarea以及select对象时,即光标落在文本框或选择框时会产生该事件.<br />
如:&lt;select name="zhengjian" onfocus="alert("我成为焦点")&gt;<br />
&nbsp;<br />
5.失去焦点事件______onblur<br />
失去焦点事件正好与获得焦点事件相对,当text对象,textarea对象或select对象不再拥有焦点而退出后台时,引发该事件.<br />
&nbsp;<br />
6.载入文件事件____onload<br />
当页面文件载入时,产生该事件.onload的一个作用就是在首次载入一个页面文件时检测cookie的值,并用一个变量为其赋值,使它可以被源代码使用,本事件是window的事件,但是在HTML中指定事件处理程序时,一般把它写在&lt;body&gt;标记中.<br />
如:&lt;body onload=alert("正在加载页面,请等待...")&gt;<br />
&nbsp;<br />
7.卸载文件事件____onunload<br />
与载入文件事件onload正好相反,当web页面退出时引发的事件,并可更新cookie的状态<br />
如:&lt;body onunload="confirm("你确定要离开本页?")&gt;<br />
&nbsp;<br />
8.鼠标覆盖事件 _____onmouseover<br />
onmouseover是当鼠标位于元素上方时所引发的事件<br />
如:&lt;input type="boutton" value="按钮" onmouseover="window.status='请您注意下面的状态栏'; return true"&gt;<br />
&nbsp;<br />
9.鼠标离开事件_____onmouseout<br />
onmouseout是鼠标离开元素里引发的事件.如果和鼠标覆盖事件同时使用,可以创建动态按钮的效果.<br />
&nbsp;<br />
10.一般事件<br />
ondbclick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 鼠标双击事件<br />
鼠标上的按键被按下时激活的事件<br />
鼠标按下后,松开鼠标时触发的事件<br />
鼠标移动里触发的事件.<br />
onkeypress&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当键盘上的某个键被按下并且释放时触发的事件,要求页面内必须有激活对象<br />
onkeydown&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当键盘上某个键被按下时触发的事件,要求页面内必须有激活对象<br />
onkeyup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当键盘上某个按键被放开时触发的事件,要求页面内必须有激活对象<br />
&nbsp;<br />
11.页面相关事件<br />
onabort&nbsp;&nbsp; 图片在下载时被用户中断<br />
onbeforeunload&nbsp;&nbsp; 当前页面的内容将要被改变时触发的事件<br />
onerror&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 捕捉当前页面因为某种原因而出现的错误,如脚本错误.<br />
onmove&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 浏览器的窗口被移动里触发的事件<br />
onresize&nbsp;&nbsp;&nbsp;&nbsp; 当浏览器的大小被改变时触发的事件<br />
onscroll&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 浏览器的滚动条位置发生变化时触发的事件<br />
onstop&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 浏览器的"停止"按钮被按下或者正在下载的文件被中断时触发的事件.<br />
&nbsp;<br />
12. 表单相关事件<br />
onreset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当表单中reset属性被激活时触发的事件.<br />
onsubmit&nbsp; 一个表单被递交时触发的事件.<br />
&nbsp;<br />
13.滚动字幕事件<br />
onbounce&nbsp;&nbsp;&nbsp; 当marquee内的内容移动至marquee显示范围之外时触发的事件.<br />
onfinish&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当marquee元素完成需要显示的内容后触发的事件.<br />
onstart&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当marquee元素开始显示内容时触发的事件.<br />
&nbsp;<br />
14.编辑事件.<br />
onbeforecopy&nbsp;&nbsp;&nbsp; 当页面当前的被选择内容将要复制到浏览者系统的剪贴板前触发的事件.<br />
onbeforeupdate&nbsp; 当浏览者粘贴系统剪贴板中的内容时通知目标对象<br />
oncontextmenu&nbsp;&nbsp; 当按下鼠标右键出现菜单或通过键盘的按键触发页面菜单时触发的事件.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;body oncontentmenu="return false"&gt;禁止使用鼠标右键<br />
oncopy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当页面当前被选择内容被复制后触发的事件<br />
oncut&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当页面当前被选择内容被剪切时触发的事件<br />
onpaste&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当内容被粘贴时触发的事件<br />
ondrag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当某个对象被拖动时触发的事件<br />
ondragend&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当鼠标拖动结束时触发的事件,即鼠标的按键被释放时触发的事件.<br />
&nbsp;<br />
15.数据绑定<br />
onafterupdate&nbsp;&nbsp;&nbsp; 当数据完成由数据源到对象的传送时触发的事件<br />
oncellchange&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当数据来源发生变化时触发的事件<br />
ondataavailable&nbsp; 当数据接收完成时触发的事件<br />
ondatasetchanged&nbsp;&nbsp; 数据在数据源发生变化时触发的事件.<br />
ondatasetcomplete&nbsp;&nbsp; 当数据源的全部有效数据读取完毕时触发的事件.<br />
onerrorupdate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当使用onbeforeupdate事件触发取消了数据传送时,代替onafterupdate事件.<br />
onrowenter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当前数据源的数据发生变化并且有新的有效数据时触发的事件.<br />
onrowexit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当前数据源的数据将要发生变化时触发的事件<br />
onrowsdelete&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当前数据记录将被删除时触发的事件<br />
onrowsinserted&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当前数据源将要插入新数据记录时触发的事件<br />
&nbsp;<br />
16.外部事件<br />
onafterprint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当文档被打印后触发的事件<br />
onbeforeprint&nbsp;&nbsp; 当文档即将打印时触发的事件<br />
onhelp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当浏览者按下F1键或者单击浏览器中的"帮助"按钮时触发的事件 </div>
<script type="text/javascript"><!-- google_ad_client="pub-1076724771190722" ;
/* JE个人博客468x60 */ google_ad_slot="5506163105" ; google_ad_width="468;
google_ad_height" = 60;
//-->
</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script><script src="http://pagead2.googlesyndication.com/pagead/js/r20101117/r20101214/show_ads_impl.js"></script><script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"></script><script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"></script><script src="http://pagead2.googlesyndication.com/pagead/render_ads.js"></script><script>google_protectAndRun("render_ads.js::google_render_ad", google_handleError, google_render_ad);</script>
<img src ="http://www.blogjava.net/zeroline/aggbug/341087.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zeroline/" target="_blank">zeroline</a> 2010-12-19 10:31 <a href="http://www.blogjava.net/zeroline/archive/2010/12/19/341087.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>15款js编辑器大全 收藏</title><link>http://www.blogjava.net/zeroline/archive/2010/12/19/341084.html</link><dc:creator>zeroline</dc:creator><author>zeroline</author><pubDate>Sun, 19 Dec 2010 01:44:00 GMT</pubDate><guid>http://www.blogjava.net/zeroline/archive/2010/12/19/341084.html</guid><wfw:comment>http://www.blogjava.net/zeroline/comments/341084.html</wfw:comment><comments>http://www.blogjava.net/zeroline/archive/2010/12/19/341084.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zeroline/comments/commentRss/341084.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zeroline/services/trackbacks/341084.html</trackback:ping><description><![CDATA[<table style="table-layout: fixed; width: 100%">
    <tbody>
        <tr>
            <td>
            <div class="cnt" id="blog_text">
            <p>看了一下,感觉不错,先收藏一下.以后说不定有用.</p>
            <div class="post">
            <ol>
                <li><font size="2">非常实用的163邮箱编辑器  </font><font color="#0000ff" size="2"><strong></strong><font color="#000000"> </font><a href="http://bbs.80nian.net/attachment.php?aid=21&amp;k=2b89910b46f7b157e86b635a41a3b3f5&amp;t=1212304753" target="_blank" mce_href="http://bbs.80nian.net/attachment.php?aid=21&amp;k=2b89910b46f7b157e86b635a41a3b3f5&amp;t=1212304753"><strong><font color="#0000ff" size="2">new163Editor.rar</font><img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.38/t.gif"  alt="" /></strong><img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a><font size="2"><font color="#000000"> (395.12 KB) </font><br />
                </font></font>
                <li><font size="2">2 <font color="#810081">soEditor v 2.5 lite</font> </font>
                <p><font size="2">官方: </font><font color="#0000ff" size="2"><a href="http://www.siteobjects.com/pages/index.cfm">http://www.siteobjects.com/pages/index.cfm<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">下载: </font><font color="#0000ff" size="2"><a href="http://www.siteobjects.com/pages/order.cfm">http://www.siteobjects.com/pages/order.cfm<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">可 以下载的是lite版, 目前还没找到pro版的. 可以支持ASP,Coldfusion,ASP.NET. 界面做的很整洁,但没有文件管理,最大的问题是对于直接从其他处复制来的图片不会做自动修正.当然这个也仁者见仁了. soEditor 2.5 is an extremely powerful browser-based WYSIWYG content authoring tool </font></p>
                <p><font size="2">designed specifically for dynamic web applications. This customizable editor allows </font></p>
                <p><font size="2">developers to make it possible for anyone to create, edit and maintain web content </font></p>
                <p><font size="2">without the need for HTML knowledge or programming expertise. </font></p>
                <li>
                <p><font size="2"><font color="#810081">AreaEdit V 0.4.2</font> 演示: </font><font color="#0000ff" size="2"><a href="http://www.formvista.com/uploaded_html/demos/areaedit/examples/simple_example.php">http://www.formvista.com/uploaded_html/demos/areaedit/examples/simple_example.php<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">下载: </font><font color="#0000ff" size="2"><a href="http://www.formvista.com/goalTracker/stream_download.php/14/areaedit_0.4.3.tar.gz">http://www.formvista.com/goalTracker/stream_download.php/14/areaedit_0.4.3.tar.gz<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">支持: </font><font color="#0000ff" size="2"><a href="http://www.formvista.com/forum">http://www.formvista.com/forum<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">修 改htmlarea的编辑器增加了图片文件管理器 htmlarea 作为在线编辑器领域的开源作品享有不错的知名度有很多的支持者和插件开发者,这些都得益于html良好的扩展性. AreaEdit is a formVista compatible fork of the rapidly developing Xinha project. </font></p>
                <p><font size="2">It is the code that is generated by the formVista FVML &lt;htmleditor&gt; tag during rendering. Xinha itself is a fork of the original HTMLArea component created by Mihai Bazon and </font></p>
                <p><font size="2">sponsored by Interactivetools. AreaEdit maintains the original HTMLArea (modified BSD) </font></p>
                <p><font size="2">license and is free to use. While it is designed to work within formVista without modification, AreaEdit does not </font></p>
                <p><font size="2">requre formVista. It is a fully functional editor component supporting a number of </font></p>
                <p><font size="2">plugins and can as easily be used as a standalone editor component for any PHP web </font></p>
                <p><font size="2">application. The primary difference between AreaEdit and Xinha is one of focus. The Xinha project </font></p>
                <p><font size="2">aims to be a rapidly developing feature-filled editor with many plugins. By contrast, AreaEdit takes a slower minimalists approach. It aims first and foremost </font></p>
                <p><font size="2">to be functional and maintainable. The feature set we are focusing on is targeted </font></p>
                <p><font size="2">squarely at the serious non-technical business user. Business users don&amp;apos;t care </font></p>
                <p><font size="2">about the nuances of HTML &lt;br&gt; and &lt;p&gt; tags, they just want the editor to work as </font></p>
                <p><font size="2">they would expect. If your audience is primarly composed to developers or those familar with HTML, you</font></p>
                <p><font size="2">should take a look at Xinha. AreaEdit is known to work with MSIE 5.5 or later and any modern Gecko based </font></p>
                <p><font size="2">browsers. (FireFox, Mozilla).</font></p>
                <li>
                <p><font size="2"><font color="#810081">DevEdit Version 5.0.1 破解版</font> 官方网站: </font><font color="#0000ff" size="2"><a href="http://www.interspire.com/">http://www.interspire.com<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">演示: </font><font color="#0000ff" size="2"><a href="http://www.interspire.com/devedit/demo.php">http://www.interspire.com/devedit/demo.php<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">下载: </font><font color="#0000ff" size="2"><a href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/devedit.rar">http://bbs.80nian.net/thread-259-1-1.html?acdt=/devedit.rar<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2"><font color="#a52a2a">警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题本站概不负责</font> </font></p>
                <li>
                <p><font size="2"><font color="#a52a2a"><font color="#0000ff">Web Wiz Rich Text Editor v3.0</font><font color="#000000"> </font></font>下载: </font><font color="#0000ff" size="2"><a href="http://www.webwizguide.info/asp/sample_scripts/RTE_application.asp">http://www.webwizguide.info/asp/sample_scripts/RTE_application.asp<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">演示: </font><font color="#0000ff" size="2"><a href="http://www.richtexteditor.org/demo/">http://www.richtexteditor.org/demo/<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">支持在线文件管理,跨浏览器,但对表格编辑功能不强,界面不够精致 6</font></p>
                <li>
                <p><font size="2"><font color="#810081">KTML.Pro.v3.5.6-SPK100</font> 下载: </font><font color="#0000ff" size="2"><a href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/KTML_PRO-3.5.6.ZIP">http://bbs.80nian.net/thread-259-1-1.html?acdt=/KTML_PRO-3.5.6.ZIP<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2"><font color="#a52a2a">警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题概不负责.</font> 有着类似dw一样的属性栏,这个是pro版,提供了lite版没有的对表格的属性编辑等功能,</font></p>
                <p><font size="2">有兴趣的可以去官方看看lite版. </font></p>
                <li>
                <p><font size="2"><font color="#0000ff">TextArea Rich v3.0</font> 下载: </font><font color="#0000ff" size="2"><a href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/textarea.rich.v3.0.rar">http://bbs.80nian.net/thread-259-1-1.html?acdt=/textarea.rich.v3.0.rar<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">做的很干净的编辑器,适合于CMS.功能强大. </font></p>
                <li>
                <p><font size="2"><strong>Tabula WYSIWYG HTML editor ver. 2.2</strong> 演示: </font><font color="#0000ff" size="2"><a href="http://www.tabula.biz/showArticle.asp?articleid=253">http://www.tabula.biz/showArticle.asp?articleid=253<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">下载: </font><font color="#0000ff" size="2"><a href="http://www.tabula.biz/ShowArticle.asp?MID=5&amp;ArticleID=257">http://www.tabula.biz/ShowArticle.asp?MID=5&amp;ArticleID=257<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">和ewebsoft很像的编辑器右键功能强悍,界面做的稍稍差了点点：） </font></p>
                <li>
                <p><font size="2"><strong>TinyMCE 2.0RC3</strong> 官方网站: </font><font color="#0000ff" size="2"><a href="http://tinymce.moxiecode.com/">http://tinymce.moxiecode.com/<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">官方演示: </font><font color="#0000ff" size="2"><a href="http://tinymce.moxiecode.com/example_full.php?example=true">http://tinymce.moxiecode.com/example_full.php?example=true<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">下载: </font><font color="#0000ff" size="2"><a href="http://keihanna.dl.sourceforge.net/sourceforge/tinymce/tinymce_2_0RC3.zip">http://keihanna.dl.sourceforge.net/sourceforge/tinymce/tinymce_2_0RC3.zip<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">有一个很好的开源编辑器,界面,功能和可扩展性做的都很好 </font></p>
                <li>
                <p><font size="2"><strong>网页在线编辑器 mEditor ASP 中文版 v2.0</strong> 下载: </font><font color="#0000ff" size="2"><a href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/meditor.zip">http://bbs.80nian.net/thread-259-1-1.html?acdt=/meditor.zip<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">运 行环境支持: 操作系统支持: Windows 2000 系列 / Window Xp 系列 / Window 2003 系列网络服务器支持: Asp 版本要求安装IIS 5.0版本或更高版本 浏览器支持: 正常运行在IE5.5以上版本,部分特殊功能要求IE版本升级到6.0以才能使用 &gt;&gt;&gt; 在网络服务器设置完成后,运行index.asp进行样式管理. &gt;&gt;&gt; 建议将mEditor放在项目的根目录. 注意事项 有关无组件上传类 v2.0 升级事项 1.修正内核部分字符编码的问题. 2.增强系统运行的健壮性与稳定性. 3.增加了"模式按钮"栏式管理,可随意启用/取消模式按钮. 4.在编辑器的样式上进行了整体的修改. 5.增加了编辑器的缩放功能,仅适用于IE5.5以上版本. 6.增加了"搜索替换"功能(快捷键CTRL+R),仅适用于IE5.5以上版本. 7.将部分功能移植到"代码模式"使用,如:"全选","删除","复制"..... 8.增加快捷键CTRL+1(预览模式),CTRL+2(代码模式),CTRL+3(视图模式),CTRL+R(查找替换). </font></p>
                <li>
                <p><font size="2"></font><font size="2"><strong>EWELive JScript Editor 0.4 6</strong> 下载:&nbsp;&nbsp;</font><font color="#0000ff" size="2"><a href="http://www.ewelive.com/downloads/0_64_JS.zip">http://www.ewelive.com/downloads/0_64_JS.zip<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">我曾经仔细的去汉化过这个版本的编辑器,加了一些自己的界面设计和按钮. 速度很快,功能简单使用,容易修改. 对于喜欢简单一族的朋友可以下来看看. 官方: </font><font color="#0000ff" size="2"><a href="http://www.ewelive.com/">http://www.ewelive.com<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> <font size="2">演示: </font><font color="#0000ff" size="2"><a href="http://www.ewelive.com/demo_js/sample.php">http://www.ewelive.com/demo_js/sample.php<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font></p>
                <li>
                <p><font size="2"><strong>InnovaStudio WYSIWYG Editor v2.3</strong> <font color="#a52a2a">警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题概不负责.</font> 界面做的很是精细, 功能极强大,非常优秀之作,强烈推荐下载 </font><font color="#0000ff" size="2"><a href="http://www225.fixdown.com/code/sp-iwe23.rar">http://www225.fixdown.com/code/sp-iwe23.rar<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font> </p>
                <li>
                <p><font size="2"><strong>CuteEditor for ASP Enterprise License</strong> <font color="#a52a2a">警告: 本程序是商业程序,仅供网友研究学习,请在下载后24小时内删除. 对于由此产生的法律问题概不负责.</font> Cuteditor 我曾研究过,不亏为成熟的商业作品,各方面做的都很规范,功能强大,也提供简体中文语言包,</font></p>
                <p><font size="2">个人非常喜欢.强烈推荐 </font><a href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar" target="_blank" mce_href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar"><img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a><font color="#0000ff" size="2">下载: </font><font color="#0000ff" size="2"><a href="http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar">http://bbs.80nian.net/thread-259-1-1.html?acdt=/CuteEditor_for_ASP_Enterprise_License.rar<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font></p>
                <li>
                <p><strong><font size="2">FCKeditor 2.6 精简版第三版新增表格功能 </font><font color="#810081" size="2"><a href="http://bbs.80nian.net/viewthread.php?tid=158&amp;highlight=FC">http://bbs.80nian.net/viewthread.php?tid=158&amp;highlight=FC<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></font></strong></p>
                </li>
            </ol>
            </div>
            <div class="feedbackCon">15 加一个新浪编辑器,不为别的,漂亮 <a href="http://test.tstring.com.cn/sinaeditor/editor.htm">http://test.tstring.com.cn/sinaeditor/editor.htm<img class="snap_preview_icon" src="http://i.ixnp.com/images/v3.41/t.gif"  alt="" /></a></div>
            </div>
            </td>
        </tr>
    </tbody>
</table>
<br />
 <img src ="http://www.blogjava.net/zeroline/aggbug/341084.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zeroline/" target="_blank">zeroline</a> 2010-12-19 09:44 <a href="http://www.blogjava.net/zeroline/archive/2010/12/19/341084.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>经典 JavaScript 正则表达式</title><link>http://www.blogjava.net/zeroline/archive/2010/11/17/338312.html</link><dc:creator>zeroline</dc:creator><author>zeroline</author><pubDate>Wed, 17 Nov 2010 13:49:00 GMT</pubDate><guid>http://www.blogjava.net/zeroline/archive/2010/11/17/338312.html</guid><wfw:comment>http://www.blogjava.net/zeroline/comments/338312.html</wfw:comment><comments>http://www.blogjava.net/zeroline/archive/2010/11/17/338312.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zeroline/comments/commentRss/338312.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zeroline/services/trackbacks/338312.html</trackback:ping><description><![CDATA[<p style="font-family: Courier"><span style="font-family: Courier">正则表达式用于字符串处理，表单验证等场合，实用高效，但用到时总是不太把握，以致往往要上网查一番。我将一些常用的表达式收藏在这里，作备忘之用。</span></p>
<p><span style="font-family: Courier">匹配中文字符的正则表达式：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: olive">[</span><span style="color: gray">\</span><span style="color: blue">u4e00</span><span style="color: gray">-\</span><span style="color: blue">u9fa5</span><span style="color: olive">]</span></span></div>
</div>
<p><span style="font-family: Courier">匹配双字节字符(包括汉字在内)：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: olive">[</span><span style="color: gray">^\</span><span style="color: blue">x00</span><span style="color: gray">-\</span><span style="color: blue">xff</span><span style="color: olive">]</span></span></div>
</div>
<p><span style="font-family: Courier">应用：计算字符串的长度（一个双字节字符长度计2，ASCII字符计1）</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: teal">String</span><span style="color: gray">.</span><span style="color: blue">prototype</span><span style="color: gray">.</span><span style="color: blue">len</span><span style="color: gray">=</span><span style="color: green">function</span><span style="color: olive">(){</span><span style="color: gray"> </span><span style="color: green">return</span><span style="color: gray"> </span><span style="color: green">this</span><span style="color: gray">.</span><span style="color: blue">replace</span><span style="color: olive">([</span><span style="color: gray">^\</span><span style="color: blue">x00</span><span style="color: gray">-\</span><span style="color: blue">xff</span><span style="color: olive">]</span><span style="color: #8b0000">/</span><span style="color: red">g,"aa").length; }</span></span></div>
</div>
<p><span style="font-family: Courier">匹配空行的正则表达式：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">\</span><span style="color: blue">n</span><span style="color: olive">[</span><span style="color: gray">\</span><span style="color: blue">s</span><span style="color: gray">|</span><span style="color: olive">]</span><span style="color: gray">*\</span><span style="color: blue">r</span></span></div>
</div>
<p><span style="font-family: Courier">匹配HTML标记的正则表达式：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: #8b0000">/</span><span style="color: red">&lt;(.*)&gt;.*&lt;</span><span style="color: navy">\/</span><span style="color: red">\1&gt;|&lt;(.*) </span><span style="color: navy">\/</span><span style="color: red">&gt;</span><span style="color: #8b0000">/</span></span></div>
</div>
<p><span style="font-family: Courier">匹配首尾空格的正则表达式：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: olive">(</span><span style="color: gray">^\</span><span style="color: blue">s</span><span style="color: gray">*</span><span style="color: olive">)</span><span style="color: gray">|</span><span style="color: olive">(</span><span style="color: gray">\</span><span style="color: blue">s</span><span style="color: gray">*$</span><span style="color: olive">)</span></span></div>
</div>
<p><span style="font-family: Courier">应用：j avascript中没有像v bscript那样的trim函数，我们就可以利用这个表达式来实现，如下：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: teal">String</span><span style="color: gray">.</span><span style="color: blue">prototype</span><span style="color: gray">.</span><span style="color: blue">trim</span><span style="color: gray"> = </span><span style="color: green">function</span><span style="color: olive">()</span></span><span style="color: gray"><br />
</span><span style="color: olive"><span style="font-family: Courier">{</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="font-family: Courier"><span style="color: green">return</span><span style="color: gray"> </span><span style="color: green">this</span><span style="color: gray">.</span><span style="color: blue">replace</span><span style="color: olive">(</span><span style="color: #8b0000">/</span><span style="color: red">(^\s*)|(\s*$)</span><span style="color: #8b0000">/g</span><span style="color: gray">, </span><span style="color: #8b0000">""</span><span style="color: olive">)</span></span><span style="font-family: Courier"><span style="color: gray">;<br />
</span><span style="color: olive">}</span></span></div>
</div>
<p><span style="font-family: Courier">利用正则表达式分解和转换IP地址<br />
下面是利用正则表达式匹配IP地址，并将IP地址转换成对应数值的Javascript程序：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: green">function</span><span style="color: gray"> </span><span style="color: blue">IP2V</span><span style="color: olive">(</span><span style="color: blue">ip</span><span style="color: olive">)</span></span><span style="color: gray"><br />
</span><span style="color: olive"><span style="font-family: Courier">{</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="font-family: Courier"><span style="color: blue">re</span><span style="color: gray">=</span><span style="color: #8b0000">/</span><span style="color: red">(\d+)\.(\d+)\.(\d+)\.(\d+)</span><span style="color: #8b0000">/g</span><span style="color: gray">&nbsp; </span><span style="color: #ffa500">//匹配IP地址的正则表达式</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="font-family: Courier"><span style="color: green">if</span><span style="color: olive">(</span><span style="color: blue">re</span><span style="color: gray">.</span><span style="color: blue">test</span><span style="color: olive">(</span><span style="color: blue">ip</span><span style="color: olive">))</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="color: olive"><span style="font-family: Courier">{</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style="font-family: Courier"><span style="color: green">return</span><span style="color: gray"> </span><span style="color: teal">RegExp</span><span style="color: gray">.$</span><span style="color: maroon">1</span><span style="color: gray">*</span><span style="color: teal">Math</span><span style="color: gray">.</span><span style="color: blue">pow</span><span style="color: olive">(</span><span style="color: maroon">255</span><span style="color: gray">,</span><span style="color: maroon">3</span><span style="color: olive">)</span><span style="color: gray">)+</span><span style="color: teal">RegExp</span><span style="color: gray">.$</span><span style="color: maroon">2</span><span style="color: gray">*</span><span style="color: teal">Math</span><span style="color: gray">.</span><span style="color: blue">pow</span><span style="color: olive">(</span><span style="color: maroon">255</span><span style="color: gray">,</span><span style="color: maroon">2</span><span style="color: olive">)</span><span style="color: gray">)+</span><span style="color: teal">RegExp</span><span style="color: gray">.$</span><span style="color: maroon">3</span><span style="color: gray">*</span><span style="color: maroon">255</span><span style="color: gray">+</span><span style="color: teal">RegExp</span><span style="color: gray">.$</span><span style="color: maroon">4</span><span style="color: gray">*</span><span style="color: maroon">1</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="color: olive"><span style="font-family: Courier">}</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="color: green"><span style="font-family: Courier">else</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="color: olive"><span style="font-family: Courier">{</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span></span><span style="font-family: Courier"><span style="color: green">throw</span><span style="color: gray"> </span><span style="color: green">new</span><span style="color: gray"> </span><span style="color: blue">Error</span><span style="color: olive">(</span><span style="color: #8b0000">"</span><span style="color: red">Not a valid IP address!</span><span style="color: #8b0000">"</span><span style="color: olive">)</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="color: olive"><span style="font-family: Courier">}</span></span><span style="color: gray"><br />
</span><span style="color: olive"><span style="font-family: Courier">}</span></span></div>
</div>
<p><span style="font-family: Courier">不过上面的程序如果不用正则表达式，而直接用split函数来分解可能更简单，程序如下：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: green">var</span><span style="color: gray"> </span><span style="color: blue">ip</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">10.100.20.168</span><span style="color: #8b0000">"</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: blue">ip</span><span style="color: gray">=</span><span style="color: blue">ip</span><span style="color: gray">.</span><span style="color: blue">split</span><span style="color: olive">(</span><span style="color: #8b0000">"</span><span style="color: red">.</span><span style="color: #8b0000">"</span><span style="color: olive">)</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: blue">alert</span><span style="color: olive">(</span><span style="color: #8b0000">"</span><span style="color: red">IP值是：</span><span style="color: #8b0000">"</span><span style="color: gray">+</span><span style="color: olive">(</span><span style="color: blue">ip</span><span style="color: olive">[</span><span style="color: maroon">0</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: maroon">255</span><span style="color: gray">*</span><span style="color: maroon">255</span><span style="color: gray">*</span><span style="color: maroon">255</span><span style="color: gray">+</span><span style="color: blue">ip</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: maroon">255</span><span style="color: gray">*</span><span style="color: maroon">255</span><span style="color: gray">+</span><span style="color: blue">ip</span><span style="color: olive">[</span><span style="color: maroon">2</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: maroon">255</span><span style="color: gray">+</span><span style="color: blue">ip</span><span style="color: olive">[</span><span style="color: maroon">3</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: maroon">1</span><span style="color: olive">))</span></span></div>
</div>
<p><span style="font-family: Courier">匹配Email地址的正则表达式：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">+</span><span style="color: olive">([</span><span style="color: gray">-+.</span><span style="color: olive">]</span><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">*@\</span><span style="color: blue">w</span><span style="color: gray">+</span><span style="color: olive">([</span><span style="color: gray">-.</span><span style="color: olive">]</span><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">*\.\</span><span style="color: blue">w</span><span style="color: gray">+</span><span style="color: olive">([</span><span style="color: gray">-.</span><span style="color: olive">]</span><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">*</span></span></div>
</div>
<p><span style="font-family: Courier">匹配网址URL的正则表达式：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: blue">http</span><span style="color: gray">:</span><span style="color: #ffa500">//([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?</span></span></div>
</div>
<p><span style="font-family: Courier">利用正则表达式去除字串中重复的字符的算法程序：[*注：此程序不正确]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: green">var</span><span style="color: gray"> </span><span style="color: blue">s</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">abacabefgeeii</span><span style="color: #8b0000">"</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: green">var</span><span style="color: gray"> </span><span style="color: blue">s1</span><span style="color: gray">=</span><span style="color: blue">s</span><span style="color: gray">.</span><span style="color: blue">replace</span><span style="color: olive">(</span><span style="color: #8b0000">/</span><span style="color: red">(.).*\1</span><span style="color: #8b0000">/g</span><span style="color: gray">,</span><span style="color: #8b0000">"</span><span style="color: red">$1</span><span style="color: #8b0000">"</span><span style="color: olive">)</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: green">var</span><span style="color: gray"> </span><span style="color: blue">re</span><span style="color: gray">=</span><span style="color: green">new</span><span style="color: gray"> </span><span style="color: teal">RegExp</span><span style="color: olive">(</span><span style="color: #8b0000">"</span><span style="color: red">[</span><span style="color: #8b0000">"</span><span style="color: gray">+</span><span style="color: blue">s1</span><span style="color: gray">+</span><span style="color: #8b0000">"</span><span style="color: red">]</span><span style="color: #8b0000">"</span><span style="color: gray">,</span><span style="color: #8b0000">"</span><span style="color: red">g</span><span style="color: #8b0000">"</span><span style="color: olive">)</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: green">var</span><span style="color: gray"> </span><span style="color: blue">s2</span><span style="color: gray">=</span><span style="color: blue">s</span><span style="color: gray">.</span><span style="color: blue">replace</span><span style="color: olive">(</span><span style="color: blue">re</span><span style="color: gray">,</span><span style="color: #8b0000">""</span><span style="color: olive">)</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: blue">alert</span><span style="color: olive">(</span><span style="color: blue">s1</span><span style="color: gray">+</span><span style="color: blue">s2</span><span style="color: olive">)</span><span style="color: gray">&nbsp; </span><span style="color: #ffa500">//结果为：abcefgi</span></span></div>
</div>
<p><span style="font-family: Courier">*注<br />
===============================<br />
如果var s = &#8220;abacabefggeeii&#8221;<br />
结果就不对了，结果为：abeicfgg<br />
正则表达式的能力有限<br />
===============================</span></p>
<p><span style="font-family: Courier">我原来在CSDN上发贴寻求一个表达式来实现去除重复字符的方法，最终没有找到，这是我能想到的最简单的实现方法。思路是使用后向引用取出包括重复的字符，再以重复的字符建立第二个表达式，取到不重复的字符，两者串连。这个方法对于字符顺序有要求的字符串可能不适用。</span></p>
<p><span style="font-family: Courier">得用正则表达式从URL地址中提取文件名的javascript程序，如下结果为page1</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: blue">s</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">http://blog.penner.cn/page1.htm</span><span style="color: #8b0000">"</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: blue">s</span><span style="color: gray">=</span><span style="color: blue">s</span><span style="color: gray">.</span><span style="color: blue">replace</span><span style="color: olive">(</span><span style="color: #8b0000">/</span><span style="color: red">(.*</span><span style="color: navy">\/</span><span style="color: red">){ 0, }([^\.]+).*</span><span style="color: #8b0000">/i</span><span style="color: blue">g</span><span style="color: gray">,</span><span style="color: #8b0000">"</span><span style="color: red">$2</span><span style="color: #8b0000">"</span><span style="color: olive">)</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: blue">alert</span><span style="color: olive">(</span><span style="color: blue">s</span><span style="color: olive">)</span></span></div>
</div>
<p><span style="font-family: Courier">利用正则表达式限制网页表单里的文本框输入内容：</span></p>
<p><span style="font-family: Courier">用正则表达式限制只能输入中文：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: blue">onkeyup</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">value=value.replace(/[^\u4E00-\u9FA5]/g,'')</span><span style="color: #8b0000">"</span><span style="color: gray"> </span><span style="color: blue">onbeforepaste</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))</span><span style="color: #8b0000">"</span></span></div>
</div>
<p><span style="font-family: Courier">用正则表达式限制只能输入全角字符：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: blue">onkeyup</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">value=value.replace(/[^\uFF00-\uFFFF]/g,'')</span><span style="color: #8b0000">"</span><span style="color: gray"> </span><span style="color: blue">onbeforepaste</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))</span><span style="color: #8b0000">"</span></span></div>
</div>
<p><span style="font-family: Courier">用正则表达式限制只能输入数字：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: blue">onkeyup</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">value=value.replace(/[^\d]/g,'') </span><span style="color: #8b0000">"</span><span style="color: blue">onbeforepaste</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))</span><span style="color: #8b0000">"</span></span></div>
</div>
<p><span style="font-family: Courier">用正则表达式限制只能输入数字和英文：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: blue">onkeyup</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">value=value.replace(/[\W]/g,'') </span><span style="color: #8b0000">"</span><span style="color: blue">onbeforepaste</span><span style="color: gray">=</span><span style="color: #8b0000">"</span><span style="color: red">clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))</span><span style="color: #8b0000">"</span></span></div>
</div>
<p><span style="font-family: Courier">匹配非负整数（正整数 + 0）</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^\</span><span style="color: blue">d</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配正整数</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">[</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配非正整数（负整数 + 0）</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">((</span><span style="color: gray">-\</span><span style="color: blue">d</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">|</span><span style="color: olive">(</span><span style="color: maroon">0</span><span style="color: gray">+</span><span style="color: olive">))</span><span style="color: gray">$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配负整数</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^-</span><span style="color: olive">[</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配整数</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^-?\</span><span style="color: blue">d</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配非负浮点数（正浮点数 + 0）</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^\</span><span style="color: blue">d</span><span style="color: gray">+</span><span style="color: olive">(</span><span style="color: gray">\.\</span><span style="color: blue">d</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">?$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配正浮点数</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">(([</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">+\.</span><span style="color: olive">[</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">)</span><span style="color: gray">|</span><span style="color: olive">([</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*\.</span><span style="color: olive">[</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">|</span><span style="color: olive">([</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">))</span><span style="color: gray">$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配非正浮点数（负浮点数 + 0）</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">((</span><span style="color: gray">-\</span><span style="color: blue">d</span><span style="color: gray">+</span><span style="color: olive">(</span><span style="color: gray">\.\</span><span style="color: blue">d</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">?</span><span style="color: olive">)</span><span style="color: gray">|</span><span style="color: olive">(</span><span style="color: maroon">0</span><span style="color: gray">+</span><span style="color: olive">(</span><span style="color: gray">\</span><span style="color: maroon">.0</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">?</span><span style="color: olive">))</span><span style="color: gray">$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配负浮点数</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">(</span><span style="color: gray">-</span><span style="color: olive">(([</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">+\.</span><span style="color: olive">[</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">)</span><span style="color: gray">|</span><span style="color: olive">([</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*\.</span><span style="color: olive">[</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">|</span><span style="color: olive">([</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">[</span><span style="color: maroon">1</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">][</span><span style="color: maroon">0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">)))</span><span style="color: gray">$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配浮点数</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">(</span><span style="color: gray">-?\</span><span style="color: blue">d</span><span style="color: gray">+</span><span style="color: olive">)(</span><span style="color: gray">\.\</span><span style="color: blue">d</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">?$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配由26个英文字母组成的字符串</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">[</span><span style="color: blue">A</span><span style="color: gray">-</span><span style="color: blue">Za</span><span style="color: gray">-</span><span style="color: blue">z</span><span style="color: olive">]</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配由26个英文字母的大写组成的字符串</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">[</span><span style="color: blue">A</span><span style="color: gray">-</span><span style="color: blue">Z</span><span style="color: olive">]</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配由26个英文字母的小写组成的字符串</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">[</span><span style="color: blue">a</span><span style="color: gray">-</span><span style="color: blue">z</span><span style="color: olive">]</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配由数字和26个英文字母组成的字符串</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">[</span><span style="color: blue">A</span><span style="color: gray">-</span><span style="color: blue">Za</span><span style="color: gray">-</span><span style="color: blue">z0</span><span style="color: gray">-</span><span style="color: maroon">9</span><span style="color: olive">]</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配由数字、26个英文字母或者下划线组成的字符串</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^\</span><span style="color: blue">w</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配email地址</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">[</span><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">-</span><span style="color: olive">]</span><span style="color: gray">+</span><span style="color: olive">(</span><span style="color: gray">\.</span><span style="color: olive">[</span><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">-</span><span style="color: olive">]</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">*@</span><span style="color: olive">[</span><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">-</span><span style="color: olive">]</span><span style="color: gray">+</span><span style="color: olive">(</span><span style="color: gray">\.</span><span style="color: olive">[</span><span style="color: gray">\</span><span style="color: blue">w</span><span style="color: gray">-</span><span style="color: olive">]</span><span style="color: gray">+</span><span style="color: olive">)</span><span style="color: gray">+$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配url</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">^</span><span style="color: olive">[</span><span style="color: blue">a</span><span style="color: gray">-</span><span style="color: blue">zA</span><span style="color: gray">-</span><span style="color: blue">z</span><span style="color: olive">]</span><span style="color: gray">+:</span><span style="color: #ffa500">//匹配(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$</span></span></div>
</div>
<p><span style="font-family: Courier">匹配html tag</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: gray">&lt;\</span><span style="color: blue">s</span><span style="color: gray">*</span><span style="color: olive">(</span><span style="color: gray">\</span><span style="color: blue">S</span><span style="color: gray">+</span><span style="color: olive">)(</span><span style="color: gray">\</span><span style="color: blue">s</span><span style="color: olive">[</span><span style="color: gray">^&gt;</span><span style="color: olive">]</span><span style="color: gray">*</span><span style="color: olive">)</span><span style="color: gray">?&gt;</span><span style="color: olive">(</span><span style="color: gray">.*?</span><span style="color: olive">)</span><span style="color: gray">&lt;\</span><span style="color: blue">s</span><span style="color: gray">*\</span><span style="color: #8b0000">/</span><span style="color: red">\1\s*&gt;</span></span></div>
</div>
<p><span style="font-family: Courier">Visual Basic &amp; C# Regular Expression<br />
1.确认有效电子邮件格式<br />
下面的示例使用静态 Regex.IsMatch 方法验证一个字符串是否为有效电子邮件格式。如果字符串包含一个有效的电子邮件地址，则 IsValidEmail 方法返回 true，否则返回 false，但不采取其他任何操作。您可以使用 IsValidEmail，在应用程序将地址存储在数据库中或显示在 ASP.NET 页中之前，筛选出包含无效字符的电子邮件地址。</span></p>
<p><span style="font-family: Courier">[Visual Basic]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">Function IsValidEmail(strIn As String) As Boolean<br />
' Return true if strIn is in valid e-mail format.<br />
Return Regex.IsMatch(strIn, ("^([\w-\.]+)@((\[[0-9]{ 1,3 }\.[0-9]{ 1,3 }\.[0-9]{ 1,3 }\.)|(([\w-]+\.)+))([a-zA-Z]{ 2,4 }|[0-9]{ 1,3 })(\]?)$")<br />
End Function</span></div>
</div>
<p><span style="font-family: Courier">[C#]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">bool IsValidEmail(string strIn)<br />
{<br />
// Return true if strIn is in valid e-mail format.<br />
return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{ 1,3 }\.[0-9]{ 1,3 }\.[0-9]{ 1,3 }\.)|(([\w-]+\.)+))([a-zA-Z]{ 2,4 }|[0-9]{ 1,3 })(\]?)$");<br />
}</span></div>
</div>
<p><span style="font-family: Courier">2.清理输入字符串<br />
下面的代码示例使用静态 Regex.Replace 方法从字符串中抽出无效字符。您可以使用这里定义的 CleanInput 方法，清除掉在接受用户输入的窗体的文本字段中输入的可能有害的字符。CleanInput 在清除掉除 @、-（连字符）和 .（句点）以外的所有非字母数字字符后返回一个字符串。</span></p>
<p><span style="font-family: Courier">[Visual Basic]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">Function CleanInput(strIn As String) As String<br />
' Replace invalid characters with empty strings.<br />
Return Regex.Replace(strIn, "[^\w\.@-]", "")<br />
End Function</span></div>
</div>
<p><span style="font-family: Courier">[C#]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">String CleanInput(string strIn)<br />
{<br />
&nbsp;&nbsp; &nbsp;// Replace invalid characters with empty strings.<br />
&nbsp;&nbsp; &nbsp;return Regex.Replace(strIn, @"[^\w\.@-]", "");<br />
}</span></div>
</div>
<p><span style="font-family: Courier">3.更改日期格式<br />
以下代码示例使用 Regex.Replace 方法来用 dd-mm-yy 的日期形式代替 mm/dd/yy 的日期形式。</span></p>
<p><span style="font-family: Courier">[Visual Basic]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">Function MDYToDMY(input As String) As String<br />
Return Regex.Replace(input, _<br />
"\b(?&lt;month&gt;\d{ 1,2 })/(?&lt;day&gt;\d{ 1,2 })/(?&lt;year&gt;\d{ 2,4 })\b", _<br />
"${ day }-${ month }-${ year }")<br />
End Function</span></div>
</div>
<p><span style="font-family: Courier">[C#]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">String MDYToDMY(String input)<br />
{<br />
&nbsp;&nbsp; &nbsp;return Regex.Replace(input,"\\b(?&lt;month&gt;\\d{ 1,2 })/(?&lt;day&gt;\\d{ 1,2 })/(?&lt;year&gt;\\d{ 2,4 })\\b","${ day }-${ month }-${ year }");<br />
}</span></div>
</div>
<p><span style="font-family: Courier">Regex 替换模式<br />
本示例说明如何在 Regex.Replace 的替换模式中使用命名的反向引用。其中，替换表达式 ${ day } 插入由 (?&#8230;) 组捕获的子字符串。</span></p>
<p><span style="font-family: Courier">有几种静态函数使您可以在使用正则表达式操作时无需创建显式正则表达式对象，而 Regex.Replace 函数正是其中之一。如果您不想保留编译的正则表达式，这将给您带来方便</span></p>
<p><span style="font-family: Courier">4.提取 URL 信息<br />
以下代码示例使用 Match.Result 来从 URL 提取协议和端口号。例如，&#8220;http://www.penner.cn:8080&#8230;&#8230;将返回&#8220;http:8080&#8221;。</span></p>
<p><span style="font-family: Courier">[Visual Basic]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">Function Extension(url As String) As String<br />
Dim r As New Regex("^(?&lt;proto&gt;\w+)://[^/]+?(?&lt;port&gt;:\d+)?/", _<br />
RegexOptions.Compiled)<br />
Return r.Match(url).Result("${ proto }${ port }")<br />
End Function</span></div>
</div>
<p><span style="font-family: Courier">[C#]</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier">String Extension(String url)<br />
{<br />
&nbsp;&nbsp; &nbsp;Regex r = new Regex(@"^(?&lt;proto&gt;\w+)://[^/]+?(?&lt;port&gt;:\d+)?/",<br />
&nbsp;&nbsp; &nbsp;RegexOptions.Compiled);<br />
&nbsp;&nbsp; &nbsp;return r.Match(url).Result("${ proto }${ port }");<br />
}</span></div>
</div>
<p><span style="font-family: Courier">只有字母和数字，不小于6位，且数字字母都包含的密码的正则表达式<br />
在C#中，可以用这个来表示：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: #8b0000">"</span><span style="color: red">\w{ 6 }(\w+)*</span><span style="color: #8b0000">"</span></span></div>
</div>
<p><span style="font-family: Courier">一个将需要将路径字符串拆分为根目录和子目录两部分的算法程序，考虑路径格式有：C:\aa\bb\cc ，\\aa\bb\cc ， ftp://aa.bb/cc 上述路径将分别被拆分为：C:\和aa\bb\cc ，\\aa 和 \bb\cc ， ftp:// 和 aa.bb/cc 用javascript实现如下：</span></p>
<div class="hl-surround">
<div class="hl-main"><span style="font-family: Courier"><span style="color: green">var</span><span style="color: gray"> </span><span style="color: blue">strRoot</span><span style="color: gray">,</span><span style="color: blue">strSub</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: green">var</span><span style="color: gray"> </span><span style="color: blue">regPathParse</span><span style="color: gray">=</span><span style="color: #8b0000">/</span><span style="color: red">^([^\\^</span><span style="color: navy">\/</span><span style="color: red">]+[\\</span><span style="color: navy">\/</span><span style="color: red">]+|\\\\[^\\]+)(.*)$</span><span style="color: #8b0000">/</span></span><span style="color: gray"><br />
</span><span style="font-family: Courier"><span style="color: green">if</span><span style="color: olive">(</span><span style="color: blue">regPathParse</span><span style="color: gray">.</span><span style="color: blue">test</span><span style="color: olive">(</span><span style="color: blue">strFolder</span><span style="color: olive">))</span></span><span style="color: gray"><br />
</span><span style="color: olive"><span style="font-family: Courier">{</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="font-family: Courier"><span style="color: blue">strRoot</span><span style="color: gray">=</span><span style="color: teal">RegExp</span><span style="color: gray">.$</span><span style="color: maroon">1</span></span><span style="color: gray"><br />
<span style="font-family: Courier">&nbsp;&nbsp; &nbsp;</span></span><span style="font-family: Courier"><span style="color: blue">strSub</span><span style="color: gray">=</span><span style="color: teal">RegExp</span><span style="color: gray">.$</span><span style="color: maroon">2</span></span><span style="color: gray"><br />
</span><span style="color: olive"><span style="font-family: Courier">}</span></span></div>
</div>
<img src ="http://www.blogjava.net/zeroline/aggbug/338312.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zeroline/" target="_blank">zeroline</a> 2010-11-17 21:49 <a href="http://www.blogjava.net/zeroline/archive/2010/11/17/338312.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>常用的js验证数字，电话号码，传真，邮箱，手机号码，邮编，日期 </title><link>http://www.blogjava.net/zeroline/archive/2010/11/17/338310.html</link><dc:creator>zeroline</dc:creator><author>zeroline</author><pubDate>Wed, 17 Nov 2010 13:44:00 GMT</pubDate><guid>http://www.blogjava.net/zeroline/archive/2010/11/17/338310.html</guid><wfw:comment>http://www.blogjava.net/zeroline/comments/338310.html</wfw:comment><comments>http://www.blogjava.net/zeroline/archive/2010/11/17/338310.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zeroline/comments/commentRss/338310.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zeroline/services/trackbacks/338310.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;1、数字&nbsp;&nbsp;function&nbsp;testisNum(object)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{...&nbsp;&nbsp;<a href='http://www.blogjava.net/zeroline/archive/2010/11/17/338310.html'>阅读全文</a><img src ="http://www.blogjava.net/zeroline/aggbug/338310.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zeroline/" target="_blank">zeroline</a> 2010-11-17 21:44 <a href="http://www.blogjava.net/zeroline/archive/2010/11/17/338310.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用JS对表格中的行进行增删</title><link>http://www.blogjava.net/zeroline/archive/2010/11/11/337854.html</link><dc:creator>zeroline</dc:creator><author>zeroline</author><pubDate>Thu, 11 Nov 2010 14:33:00 GMT</pubDate><guid>http://www.blogjava.net/zeroline/archive/2010/11/11/337854.html</guid><wfw:comment>http://www.blogjava.net/zeroline/comments/337854.html</wfw:comment><comments>http://www.blogjava.net/zeroline/archive/2010/11/11/337854.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zeroline/comments/commentRss/337854.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zeroline/services/trackbacks/337854.html</trackback:ping><description><![CDATA[<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; font-family: Courier; background-color: #eeeeee"><span style="color: #008080">&nbsp;1</span><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&lt;!</span><span style="color: #000000">DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Transitional//EN</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;2</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">html&nbsp;xmlns</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">http://www.w3.org/1999/xhtml</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;3</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;4</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">meta&nbsp;http</span><span style="color: #000000">-</span><span style="color: #000000">equiv</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">Content-Type</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;content</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;&nbsp;charset=utf-8</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;5</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">JS_array</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;6</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">script&nbsp;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">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">&nbsp;7</span><span style="color: #000000"><img id="Codehighlighter1_321_462_Open_Image" onclick="this.style.display='none'; Codehighlighter1_321_462_Open_Text.style.display='none'; Codehighlighter1_321_462_Closed_Image.style.display='inline'; Codehighlighter1_321_462_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_321_462_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_321_462_Closed_Text.style.display='none'; Codehighlighter1_321_462_Open_Image.style.display='inline'; Codehighlighter1_321_462_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;printArray()</span><span id="Codehighlighter1_321_462_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_321_462_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">&nbsp;8</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;arr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;Array()&nbsp;;<br />
</span><span style="color: #008080">&nbsp;9</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[</span><span style="color: #000000">0</span><span style="color: #000000">]&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">One</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;;<br />
</span><span style="color: #008080">10</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[</span><span style="color: #000000">1</span><span style="color: #000000">]&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">Two</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;;<br />
</span><span style="color: #008080">11</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[</span><span style="color: #000000">5</span><span style="color: #000000">]&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">Five</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;;<br />
</span><span style="color: #008080">12</span><span style="color: #000000"><img id="Codehighlighter1_436_459_Open_Image" onclick="this.style.display='none'; Codehighlighter1_436_459_Open_Text.style.display='none'; Codehighlighter1_436_459_Closed_Image.style.display='inline'; Codehighlighter1_436_459_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_436_459_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_436_459_Closed_Text.style.display='none'; Codehighlighter1_436_459_Open_Image.style.display='inline'; Codehighlighter1_436_459_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">arr.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_436_459_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_436_459_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">13</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(arr[i])&nbsp;;<br />
</span><span style="color: #008080">14</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">15</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">16</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">17</span><span style="color: #000000"><img id="Codehighlighter1_486_638_Open_Image" onclick="this.style.display='none'; Codehighlighter1_486_638_Open_Text.style.display='none'; Codehighlighter1_486_638_Closed_Image.style.display='inline'; Codehighlighter1_486_638_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_486_638_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_486_638_Closed_Text.style.display='none'; Codehighlighter1_486_638_Open_Image.style.display='inline'; Codehighlighter1_486_638_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;testTable()</span><span id="Codehighlighter1_486_638_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_486_638_Open_Text"><span style="color: #000000">{<br />
</span><span style="color: #008080">18</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;t1&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;document.getElementById('t1')&nbsp;;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">返回指定ID的&nbsp;html&nbsp;DOM&nbsp;对象</span><span style="color: #008000"><br />
</span><span style="color: #008080">19</span><span style="color: #008000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;rows&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;t1.rows;<br />
</span><span style="color: #008080">20</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(rows.length)&nbsp;;<br />
</span><span style="color: #008080">21</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(rows[</span><span style="color: #000000">1</span><span style="color: #000000">].cells[</span><span style="color: #000000">0</span><span style="color: #000000">].innerHTML)&nbsp;;<br />
</span><span style="color: #008080">22</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">23</span><span style="color: #000000"><img id="Codehighlighter1_661_771_Open_Image" onclick="this.style.display='none'; Codehighlighter1_661_771_Open_Text.style.display='none'; Codehighlighter1_661_771_Closed_Image.style.display='inline'; Codehighlighter1_661_771_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_661_771_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_661_771_Closed_Text.style.display='none'; Codehighlighter1_661_771_Open_Image.style.display='inline'; Codehighlighter1_661_771_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;deleteRow()</span><span id="Codehighlighter1_661_771_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_661_771_Open_Text"><span style="color: #000000">{&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">删除最后一行</span><span style="color: #008000"><br />
</span><span style="color: #008080">24</span><span style="color: #008000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;t1&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;document.getElementById('t1')&nbsp;;<br />
</span><span style="color: #008080">25</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;rows&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;t1.rows&nbsp;;<br />
</span><span style="color: #008080">26</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1.deleteRow(rows.length</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">)&nbsp;;<br />
</span><span style="color: #008080">27</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">28</span><span style="color: #000000"><img id="Codehighlighter1_794_1014_Open_Image" onclick="this.style.display='none'; Codehighlighter1_794_1014_Open_Text.style.display='none'; Codehighlighter1_794_1014_Closed_Image.style.display='inline'; Codehighlighter1_794_1014_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_794_1014_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_794_1014_Closed_Text.style.display='none'; Codehighlighter1_794_1014_Open_Image.style.display='inline'; Codehighlighter1_794_1014_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;insertRow()</span><span id="Codehighlighter1_794_1014_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_794_1014_Open_Text"><span style="color: #000000">{&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">在最后一行添加一行</span><span style="color: #008000"><br />
</span><span style="color: #008080">29</span><span style="color: #008000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;t1&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;document.getElementById('t1')&nbsp;;<br />
</span><span style="color: #008080">30</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;rows&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;t1.rows&nbsp;;<br />
</span><span style="color: #008080">31</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;newRow&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;t1.insertRow(rows.length)&nbsp;;<br />
</span><span style="color: #008080">32</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newRow.insertCell(</span><span style="color: #000000">0</span><span style="color: #000000">).innerHTML&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">11&amp;nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;;<br />
</span><span style="color: #008080">33</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newRow.insertCell(</span><span style="color: #000000">1</span><span style="color: #000000">).innerHTML&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">31&amp;nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;;<br />
</span><span style="color: #008080">34</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br />
</span><span style="color: #008080">35</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">36</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">script</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">37</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">38</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">39</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">40</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><br />
</span><span style="color: #008080">41</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">table&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">t1</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;width</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">200</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;border</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">1</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;cellspacing</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">0</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;cellpadding</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">0</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">42</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">43</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000">0</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">44</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;&amp;</span><span style="color: #000000">nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">45</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">46</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">47</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000">1</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">48</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;&amp;</span><span style="color: #000000">nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">49</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">50</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">51</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000">2</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">52</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;&amp;</span><span style="color: #000000">nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">53</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">54</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">55</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000">3</span><span style="color: #000000">,</span><span style="color: #000000">0</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">56</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">td</span><span style="color: #000000">&gt;&amp;</span><span style="color: #000000">nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">td</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">57</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">tr</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">58</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">table</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">59</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">p</span><span style="color: #000000">&gt;&amp;</span><span style="color: #000000">nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">60</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">61</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">button</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">click</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;onclick</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">testTable();</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">62</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">63</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">p</span><span style="color: #000000">&gt;&lt;</span><span style="color: #000000">br&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">64</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">button</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">delete&nbsp;row</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;onclick</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">deleteRow()</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;<br />
</span><span style="color: #008080">65</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">66</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">button</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;value</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">insert&nbsp;row</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;onclick</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">insertRow()</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">67</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">68</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">p</span><span style="color: #000000">&gt;&amp;</span><span style="color: #000000">nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">p</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">69</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">70</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br />
</span><span style="color: #008080">71</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<br />
下图是显示效果<br />
<img height="266" alt="" src="http://www.blogjava.net/images/blogjava_net/zeroline/2.JPG" width="276" border="0" />
<img src ="http://www.blogjava.net/zeroline/aggbug/337854.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zeroline/" target="_blank">zeroline</a> 2010-11-11 22:33 <a href="http://www.blogjava.net/zeroline/archive/2010/11/11/337854.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaScript中复选框的全选和反选功能的实现</title><link>http://www.blogjava.net/zeroline/archive/2010/11/11/337847.html</link><dc:creator>zeroline</dc:creator><author>zeroline</author><pubDate>Thu, 11 Nov 2010 13:58:00 GMT</pubDate><guid>http://www.blogjava.net/zeroline/archive/2010/11/11/337847.html</guid><wfw:comment>http://www.blogjava.net/zeroline/comments/337847.html</wfw:comment><comments>http://www.blogjava.net/zeroline/archive/2010/11/11/337847.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zeroline/comments/commentRss/337847.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zeroline/services/trackbacks/337847.html</trackback:ping><description><![CDATA[这是我平时学习时的练习，贴出来跟大家一起讨论，本来是新手，欢迎老手指正错误。<br />
<br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; font-family: Courier; background-color: #eeeeee"><span style="color: #008080">&nbsp;1</span><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #000000">&lt;!</span><span style="color: #000000">DOCTYPE&nbsp;HTML&nbsp;PUBLIC&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">-//W3C//DTD&nbsp;HTML&nbsp;4.01//EN</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">http://www.w3.org/TR/html4/strict.dtd</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;2</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;3</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;4</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">meta&nbsp;http</span><span style="color: #000000">-</span><span style="color: #000000">equiv</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">Content-Type</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;content</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/html;&nbsp;charset=utf-8</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;5</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">Test&nbsp;CheckBox</span><span style="color: #000000">&lt;/</span><span style="color: #000000">title</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;6</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">style&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">text/css</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;7</span><span style="color: #000000"><img id="Codehighlighter1_300_363_Open_Image" onclick="this.style.display='none'; Codehighlighter1_300_363_Open_Text.style.display='none'; Codehighlighter1_300_363_Closed_Image.style.display='inline'; Codehighlighter1_300_363_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_300_363_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_300_363_Closed_Text.style.display='none'; Codehighlighter1_300_363_Open_Image.style.display='inline'; Codehighlighter1_300_363_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body</span><span id="Codehighlighter1_300_363_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_300_363_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;8</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font</span><span style="color: #000000">-</span><span style="color: #000000">family:Courier;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">&nbsp;9</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">10</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">style</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">11</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">script&nbsp;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">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">12</span><span style="color: #000000"><img id="Codehighlighter1_469_1208_Open_Image" onclick="this.style.display='none'; Codehighlighter1_469_1208_Open_Text.style.display='none'; Codehighlighter1_469_1208_Closed_Image.style.display='inline'; Codehighlighter1_469_1208_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_469_1208_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_469_1208_Closed_Text.style.display='none'; Codehighlighter1_469_1208_Open_Image.style.display='inline'; Codehighlighter1_469_1208_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;checkAll()</span><span id="Codehighlighter1_469_1208_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_469_1208_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">13</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;checkAll&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;document.getElementById('chkAll')&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">14</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;checkBox&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;document.getElementById('checkBox')&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">15</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;arr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;Array()&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">16</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;checkBox.getElementsByTagName('input')&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">17</span><span style="color: #000000"><img id="Codehighlighter1_782_965_Open_Image" onclick="this.style.display='none'; Codehighlighter1_782_965_Open_Text.style.display='none'; Codehighlighter1_782_965_Closed_Image.style.display='inline'; Codehighlighter1_782_965_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_782_965_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_782_965_Closed_Text.style.display='none'; Codehighlighter1_782_965_Open_Image.style.display='inline'; Codehighlighter1_782_965_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(checkAll.checked</span><span style="color: #000000">==</span><span style="color: #0000ff">true</span><span style="color: #000000">)</span><span id="Codehighlighter1_782_965_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_782_965_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">checkAll&nbsp;selected&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000"><br />
</span><span style="color: #008080">18</span><span style="color: #008000"><img id="Codehighlighter1_858_941_Open_Image" onclick="this.style.display='none'; Codehighlighter1_858_941_Open_Text.style.display='none'; Codehighlighter1_858_941_Closed_Image.style.display='inline'; Codehighlighter1_858_941_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_858_941_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_858_941_Closed_Text.style.display='none'; Codehighlighter1_858_941_Open_Image.style.display='inline'; Codehighlighter1_858_941_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">arr.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_858_941_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_858_941_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">19</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[i].checked&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">true</span><span style="color: #000000">&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">20</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">21</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">22</span><span style="color: #000000"><img id="Codehighlighter1_1016_1182_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1016_1182_Open_Text.style.display='none'; Codehighlighter1_1016_1182_Closed_Image.style.display='inline'; Codehighlighter1_1016_1182_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1016_1182_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1016_1182_Closed_Text.style.display='none'; Codehighlighter1_1016_1182_Open_Image.style.display='inline'; Codehighlighter1_1016_1182_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(checkAll.checked</span><span style="color: #000000">==</span><span style="color: #0000ff">false</span><span style="color: #000000">)</span><span id="Codehighlighter1_1016_1182_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1016_1182_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">23</span><span style="color: #000000"><img id="Codehighlighter1_1071_1158_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1071_1158_Open_Text.style.display='none'; Codehighlighter1_1071_1158_Closed_Image.style.display='inline'; Codehighlighter1_1071_1158_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1071_1158_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1071_1158_Closed_Text.style.display='none'; Codehighlighter1_1071_1158_Open_Image.style.display='inline'; Codehighlighter1_1071_1158_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">arr.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_1071_1158_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1071_1158_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">24</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[i].checked&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">false</span><span style="color: #000000">&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">25</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">26</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">27</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">28</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">29</span><span style="color: #000000"><img id="Codehighlighter1_1250_1970_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1250_1970_Open_Text.style.display='none'; Codehighlighter1_1250_1970_Closed_Image.style.display='inline'; Codehighlighter1_1250_1970_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1250_1970_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1250_1970_Closed_Text.style.display='none'; Codehighlighter1_1250_1970_Open_Image.style.display='inline'; Codehighlighter1_1250_1970_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;checkCancel()</span><span id="Codehighlighter1_1250_1970_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1250_1970_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">30</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;checkCancel&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;document.getElementById('chkCancel')&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">31</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;checkBox&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;document.getElementById('checkBox')&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">32</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;arr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;Array()&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">33</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;checkBox.getElementsByTagName('input')&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">34</span><span style="color: #000000"><img id="Codehighlighter1_1572_1950_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1572_1950_Open_Text.style.display='none'; Codehighlighter1_1572_1950_Closed_Image.style.display='inline'; Codehighlighter1_1572_1950_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1572_1950_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1572_1950_Closed_Text.style.display='none'; Codehighlighter1_1572_1950_Open_Image.style.display='inline'; Codehighlighter1_1572_1950_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(checkCancel.checked</span><span style="color: #000000">==</span><span style="color: #0000ff">true</span><span style="color: #000000">)</span><span id="Codehighlighter1_1572_1950_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1572_1950_Open_Text"><span style="color: #000000">{&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">checkCancel&nbsp;selected&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000"><br />
</span><span style="color: #008080">35</span><span style="color: #008000"><img id="Codehighlighter1_1650_1926_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1650_1926_Open_Text.style.display='none'; Codehighlighter1_1650_1926_Closed_Image.style.display='inline'; Codehighlighter1_1650_1926_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1650_1926_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1650_1926_Closed_Text.style.display='none'; Codehighlighter1_1650_1926_Open_Image.style.display='inline'; Codehighlighter1_1650_1926_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">arr.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_1650_1926_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1650_1926_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">36</span><span style="color: #000000"><img id="Codehighlighter1_1708_1799_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1708_1799_Open_Text.style.display='none'; Codehighlighter1_1708_1799_Closed_Image.style.display='inline'; Codehighlighter1_1708_1799_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1708_1799_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1708_1799_Closed_Text.style.display='none'; Codehighlighter1_1708_1799_Open_Image.style.display='inline'; Codehighlighter1_1708_1799_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(arr[i].checked&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">true</span><span style="color: #000000">)</span><span id="Codehighlighter1_1708_1799_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1708_1799_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">37</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[i].checked&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">false</span><span style="color: #000000">&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">38</span><span style="color: #000000"><img id="Codehighlighter1_1805_1895_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1805_1895_Open_Text.style.display='none'; Codehighlighter1_1805_1895_Closed_Image.style.display='inline'; Codehighlighter1_1805_1895_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"  alt="" /><img id="Codehighlighter1_1805_1895_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1805_1895_Closed_Text.style.display='none'; Codehighlighter1_1805_1895_Open_Image.style.display='inline'; Codehighlighter1_1805_1895_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #0000ff">else</span><span style="color: #000000">&nbsp;</span><span id="Codehighlighter1_1805_1895_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"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_1805_1895_Open_Text"><span style="color: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">39</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr[i].checked&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">true</span><span style="color: #000000">&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">40</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">41</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">42</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">43</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">44</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">script</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">45</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">head</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">46</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">47</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">48</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkbox</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">chkAll</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;onclick</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkAll()</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;check&nbsp;All&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">49</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkbox</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">chkCancel</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;onclick</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkCancel()</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;check&nbsp;Cancel&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">50</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">51</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">div&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkBox</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">52</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkbox</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">chk1</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">53</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkbox</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">chk2</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">2</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">54</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkbox</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">chk3</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">3</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">55</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkbox</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">chk4</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">4</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">56</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">input&nbsp;type</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">checkbox</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">chk5</span><span style="color: #000000">"</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">5</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">br</span><span style="color: #000000">/&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">57</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">div</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">58</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">body</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">59</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #000000">&lt;/</span><span style="color: #000000">html</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #008080">60</span><span style="color: #000000"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span></div>
<br />
下图是显示效果 <br />
<img height="178" alt="" src="http://www.blogjava.net/images/blogjava_net/zeroline/1.png" width="204" border="0" /><br />
<img src ="http://www.blogjava.net/zeroline/aggbug/337847.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zeroline/" target="_blank">zeroline</a> 2010-11-11 21:58 <a href="http://www.blogjava.net/zeroline/archive/2010/11/11/337847.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>