﻿<?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>博客园-无梦家园</title><link>http://www.cnblogs.com/fanrong/</link><description>无梦家园</description><language>zh-cn</language><lastBuildDate>Fri, 05 Dec 2008 11:54:15 GMT</lastBuildDate><pubDate>Fri, 05 Dec 2008 11:54:15 GMT</pubDate><ttl>60</ttl><item><title>jbossseam</title><link>http://www.cnblogs.com/fanrong/archive/2007/11/18/963141.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Sun, 18 Nov 2007 05:20:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/11/18/963141.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/963141.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/11/18/963141.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/963141.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/963141.html</trackback:ping><description><![CDATA[<A href="http://www.jbossseam.com/">http://www.jbossseam.com/</A><img src ="http://www.cnblogs.com/fanrong/aggbug/963141.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43812/" target="_blank">[新闻]Google操作系统已开始内部测试？</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>CSS样式类别列表</title><link>http://www.cnblogs.com/fanrong/archive/2007/06/22/793166.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Fri, 22 Jun 2007 07:22:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/06/22/793166.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/793166.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/06/22/793166.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/793166.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/793166.html</trackback:ping><description><![CDATA[<P><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;以下是常用的css样式类别列表:<STRONG><FONT color=#0000ff>字体样式(font),文本样式(text),背景样式(background),盒样式(border),列表样式(ul,li).</FONT></STRONG><BR><STRONG><FONT color=#0000ff>字体样式font:</FONT></STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字体类型:font-family<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字体大小:font-size<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字体风格:font-style(斜体,正常体)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字体粗细:font-weight(粗,细)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字体颜色:color<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字体行高:line-height<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字间距:letter-spacing<BR><BR><STRONG><FONT color=#0000ff>文本样式text</FONT></STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;行间距(字体行高):line-height<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;文本修饰:text-decoration(下划线,上划线,删除线)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;水平对齐:text-align<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;垂直对齐:vertical-align<BR><BR><STRONG><FONT color=#0000ff>背景样式background:</FONT></STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;背景颜色:background-color<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;背景图片:background-image<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;背景重复:background-repeat<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;背景定位:background-position<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><FONT style="BACKGROUND-COLOR: #ffffff" color=#0000ff><STRONG>盒样式box:</STRONG></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;外边距:margin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;内边距:padding<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;边框宽度:border-width<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;边框颜色:border-color<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;边框风格:border-style&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;上边框:border-top<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;右边框:border-right<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下边框:border-bottom<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;左边框:border-left<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;宽度:width<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;高度:height<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;漂浮:float<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;清除:clear<BR><BR><STRONG><FONT color=#0000ff>列表样式ul,li:<BR></FONT></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;控制显示:display<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;符号列表:list-style-type<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;图形列表:list-style-image<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位置列表:list-style-position<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鼠标形状:cursor<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR></FONT></P><img src ="http://www.cnblogs.com/fanrong/aggbug/793166.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43811/" target="_blank">[新闻]Google阅读器界面升级 全新改版</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>样式设计概要</title><link>http://www.cnblogs.com/fanrong/archive/2007/06/22/793151.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Fri, 22 Jun 2007 06:50:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/06/22/793151.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/793151.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/06/22/793151.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/793151.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/793151.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;css样式设计中,最主要的三个概念是:<strong><font color=#0000ff>盒模型(box model),</font><span style="COLOR: #0000ff">定位(position)和浮动(float)</span></strong><span style="COLOR: #0000ff">.</span>这三个概念控制dom元素在页面上的排列和显示方式,他们是布局的基础.<br><br><strong><font color=#0000ff>盒模型(box model):</font></strong><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;网页上没一个元素都是一个矩形框(盒模型).可能我们没有看到盒本身,但实际上我们看到的内容都是包含再一个个的"盒"中的,这是因为浏览器的初始设置把"盒"的边框隐藏了.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #0000ff"><strong>边框(border),内容(content),内容和边框的距离(内边距padding)以及与其他元素的距离(外边距margin)是盒模型的4要素</strong></span>.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><strong style="COLOR: #0000ff">定位(position):</strong><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;定位决定了网页元素的表现形式.浏览器根据每个dom元素在html中出现的顺序,依次一个接一个排列,形成一个"流",这种流区别于浮动和绝对定位这两种比较特殊的定位方式,称为"普通流".<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;css有<span style="COLOR: #0000ff"><strong>三种基本的定位机制:普通流,浮动和绝对定位.(</strong></span>相对定位可以看作是普通流定位的一部分)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;定位position有以下几个主要属性:static(默认),absolute(绝对定位),relative(相对定位).<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这里的absolute(绝对定位),可以把某个元素精确的定位在某个地方.<strong style="COLOR: #0000ff">绝对定位的元素的位置相对于"最近"的"已定位"的祖先元素,如果没有已定位的祖先元素,那么它的位置相对于body</strong>.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;relative(相对定位)所谓的"相对",是相对于本元素相对于在普通流中的初始位置,它的"相对目标"是原本的自身!<br><br><span style="COLOR: #0000ff"><strong>浮动(float):<br></strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float有三个属性:left,right,none.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;它一般使用在页面布局的功能上(在UI组件设计的领域,浮动并不是太主要的概念.).<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;与浮动相关的另一个概念是清除(clear).略过...<br><br>
<img src ="http://www.cnblogs.com/fanrong/aggbug/793151.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43811/" target="_blank">[新闻]Google阅读器界面升级 全新改版</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>UI组件化开发样式设计</title><link>http://www.cnblogs.com/fanrong/archive/2007/06/22/793100.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Fri, 22 Jun 2007 06:08:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/06/22/793100.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/793100.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/06/22/793100.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/793100.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/793100.html</trackback:ping><description><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;基于web的展现方式,其根本原理是html+css!javascript只是作为一种改变Html结构和css属性的手段.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;遵循web标准的网页设计,基本的原则是:<strong style="COLOR: #0000ff">html决定结构,而css负责显示,而javascript则改变这两者.</strong><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><span style="COLOR: #0000ff"><strong>UI组件外观设计目标</strong></span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;设计开发基于组件化模型的UI时,在UI外观设计上的一个要点是:<span style="COLOR: #0000ff"><strong>保持UI组件的外观独立性</strong></span>.如:Menu可以加入不同的MenuItem,形成一个满足需求的菜单,这里组成MenuItem的html不能受到Menu的外观样式影响.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在一般的网页设计中,通常有这样的样式定义:div{...},.menu span{...}...等.这两个样式定义具有一个特性,就是"泛样式化"!.如div{...}这样定义把网页中所有的div元素都应用到此样式;而.menu span{...}则把使用.menu样式类的元素包含的所有span元素都应用到此样式.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在设计开发可组合分离的UI组件时,我们必须去除掉这样的"泛样式化"设计!当我们设计一个UI是,给这个UI设计的样式,应该只影响此UI,不能影响以后可能加入此UI中的其他UI的html外观.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;设计组件的样式,应该可以轻松更换"皮肤",以及特殊的外观定制.<br><br><strong style="COLOR: #0000ff">UI组件化样式设计原则:</strong><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1)html决定UI结构,css决定外观显示,javascript改变两者.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2)所有的外观设置,全部通过style和css样式类设计.(style的优先级最高,样式类可以多附加,后加的样式类,将覆盖前样式类的同名属性!)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3)设计样式时,只使用"样式类",如".my{...}".并且"样式类"之间可以进行一定的继承与派生.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4)避免设计"泛应用"的样式,如"p{...}",".my span{...}"等.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5)避免设计基于元素id的样式,如"#menu{...}"等.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6)样式统一抛弃简写方式,如"border:solid 1px #000;"全部写成"border-right:solid 1px #000;","border-top:solid 1px #000;","border-bottom:solid 1px #000;","border-left:solid 1px #000;",以保持最大的灵活性.(注:样式的精简不是UI组件设计首要追求的,样式的灵活性设置和切换才是!)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7)出于样式的统一和简化设计,统一使用标准的像素"px"作为基本单位.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8)必须满足IE和FF两个主流浏览器的兼容性!<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9)使用YUI的样式文件(才2K),以达到兼容不同浏览器初始样式的目的.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10)抛弃样式中,一些不必要的属性<br></p>
<img src ="http://www.cnblogs.com/fanrong/aggbug/793100.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43811/" target="_blank">[新闻]Google阅读器界面升级 全新改版</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>initialize对象状态初始化概念逻辑及意义</title><link>http://www.cnblogs.com/fanrong/archive/2007/06/20/790223.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Wed, 20 Jun 2007 04:12:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/06/20/790223.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/790223.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/06/20/790223.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/790223.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/790223.html</trackback:ping><description><![CDATA[摘要: 在javascript中,函数其实就是"类",创建一个类就是写一个函数,创建一个类的实例也相当简单,如下示例://classvarMyClass=function(firstname,lastname){this._firstname=firstname;this._lastname=lastname;this._name=this._firstname+":"+this._lastname;}M&nbsp;&nbsp;<a href='http://www.cnblogs.com/fanrong/archive/2007/06/20/790223.html'>阅读全文</a><img src ="http://www.cnblogs.com/fanrong/aggbug/790223.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43810/" target="_blank">[新闻]微软官方下载：Windows Vista SP2 Beta测试版</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>javascript索引器简析</title><link>http://www.cnblogs.com/fanrong/archive/2007/06/20/790185.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Wed, 20 Jun 2007 03:38:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/06/20/790185.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/790185.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/06/20/790185.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/790185.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/790185.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在面向对象语言的编程JAVA和C#中,都有对象"索引器"的概念.如:<br>C#实现:<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; BACKGROUND-COLOR: #eeeeee"><img id=Codehighlighter1_20_157_Open_Image onclick="this.style.display='none'; Codehighlighter1_20_157_Open_Text.style.display='none'; Codehighlighter1_20_157_Closed_Image.style.display='inline'; Codehighlighter1_20_157_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_20_157_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_20_157_Closed_Text.style.display='none'; Codehighlighter1_20_157_Open_Image.style.display='inline'; Codehighlighter1_20_157_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;MyClass</span><span id=Codehighlighter1_20_157_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_20_157_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;_name;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">索引器</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_81_155_Open_Image onclick="this.style.display='none'; Codehighlighter1_81_155_Open_Text.style.display='none'; Codehighlighter1_81_155_Closed_Image.style.display='inline'; Codehighlighter1_81_155_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_81_155_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_81_155_Closed_Text.style.display='none'; Codehighlighter1_81_155_Open_Image.style.display='inline'; Codehighlighter1_81_155_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;Name</span><span id=Codehighlighter1_81_155_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_81_155_Open_Text><span style="COLOR: #000000">{<br><img id=Codehighlighter1_94_114_Open_Image onclick="this.style.display='none'; Codehighlighter1_94_114_Open_Text.style.display='none'; Codehighlighter1_94_114_Closed_Image.style.display='inline'; Codehighlighter1_94_114_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_94_114_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_94_114_Closed_Text.style.display='none'; Codehighlighter1_94_114_Open_Image.style.display='inline'; Codehighlighter1_94_114_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">get</span><span id=Codehighlighter1_94_114_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_94_114_Open_Text><span style="COLOR: #000000">{&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name;}</span></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_127_149_Open_Image onclick="this.style.display='none'; Codehighlighter1_127_149_Open_Text.style.display='none'; Codehighlighter1_127_149_Closed_Image.style.display='inline'; Codehighlighter1_127_149_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_127_149_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_127_149_Closed_Text.style.display='none'; Codehighlighter1_127_149_Open_Image.style.display='inline'; Codehighlighter1_127_149_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">set</span><span id=Codehighlighter1_127_149_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_127_149_Open_Text><span style="COLOR: #000000">{&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;value;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div>
JAVA实现:<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; BACKGROUND-COLOR: #eeeeee"><img id=Codehighlighter1_21_157_Open_Image onclick="this.style.display='none'; Codehighlighter1_21_157_Open_Text.style.display='none'; Codehighlighter1_21_157_Closed_Image.style.display='inline'; Codehighlighter1_21_157_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_21_157_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_21_157_Closed_Text.style.display='none'; Codehighlighter1_21_157_Open_Image.style.display='inline'; Codehighlighter1_21_157_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;MyClass&nbsp;</span><span id=Codehighlighter1_21_157_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_21_157_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;String&nbsp;_name;<br><img id=Codehighlighter1_70_94_Open_Image onclick="this.style.display='none'; Codehighlighter1_70_94_Open_Text.style.display='none'; Codehighlighter1_70_94_Closed_Image.style.display='inline'; Codehighlighter1_70_94_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_70_94_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_70_94_Closed_Text.style.display='none'; Codehighlighter1_70_94_Open_Image.style.display='inline'; Codehighlighter1_70_94_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;getName()</span><span id=Codehighlighter1_70_94_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_70_94_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_130_155_Open_Image onclick="this.style.display='none'; Codehighlighter1_130_155_Open_Text.style.display='none'; Codehighlighter1_130_155_Closed_Image.style.display='inline'; Codehighlighter1_130_155_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_130_155_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_130_155_Closed_Text.style.display='none'; Codehighlighter1_130_155_Open_Image.style.display='inline'; Codehighlighter1_130_155_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;setName(String&nbsp;value)</span><span id=Codehighlighter1_130_155_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_130_155_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;value;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在javascript中,实现索引器的方法和java差不多,如下:<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; BACKGROUND-COLOR: #eeeeee"><img id=Codehighlighter1_24_30_Open_Image onclick="this.style.display='none'; Codehighlighter1_24_30_Open_Text.style.display='none'; Codehighlighter1_24_30_Closed_Image.style.display='inline'; Codehighlighter1_24_30_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_24_30_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_24_30_Closed_Text.style.display='none'; Codehighlighter1_24_30_Open_Image.style.display='inline'; Codehighlighter1_24_30_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;MyClass&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">()</span><span id=Codehighlighter1_24_30_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_24_30_Open_Text><span style="COLOR: #000000">{&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_52_196_Open_Image onclick="this.style.display='none'; Codehighlighter1_52_196_Open_Text.style.display='none'; Codehighlighter1_52_196_Closed_Image.style.display='inline'; Codehighlighter1_52_196_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_52_196_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_52_196_Closed_Text.style.display='none'; Codehighlighter1_52_196_Open_Image.style.display='inline'; Codehighlighter1_52_196_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>MyClass.prototype&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span id=Codehighlighter1_52_196_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_52_196_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;_name:&nbsp;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">,<br><img id=Codehighlighter1_95_128_Open_Image onclick="this.style.display='none'; Codehighlighter1_95_128_Open_Text.style.display='none'; Codehighlighter1_95_128_Closed_Image.style.display='inline'; Codehighlighter1_95_128_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_95_128_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_95_128_Closed_Text.style.display='none'; Codehighlighter1_95_128_Open_Image.style.display='inline'; Codehighlighter1_95_128_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;get_name:&nbsp;</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">()</span><span id=Codehighlighter1_95_128_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_95_128_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">,<br><img id=Codehighlighter1_160_194_Open_Image onclick="this.style.display='none'; Codehighlighter1_160_194_Open_Text.style.display='none'; Codehighlighter1_160_194_Closed_Image.style.display='inline'; Codehighlighter1_160_194_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_160_194_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_160_194_Closed_Text.style.display='none'; Codehighlighter1_160_194_Open_Image.style.display='inline'; Codehighlighter1_160_194_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;set_name:&nbsp;</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">(value)</span><span id=Codehighlighter1_160_194_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_160_194_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;value;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这种javascript索引器的做法,就是MS AJAX的做法.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当我们需要访问某一对象的属性时,可以由一个专门的"属性访问方法"来统一执行,如下:<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; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><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><img id=Codehighlighter1_56_58_Open_Image onclick="this.style.display='none'; Codehighlighter1_56_58_Open_Text.style.display='none'; Codehighlighter1_56_58_Closed_Image.style.display='inline'; Codehighlighter1_56_58_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_56_58_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_56_58_Closed_Text.style.display='none'; Codehighlighter1_56_58_Open_Image.style.display='inline'; Codehighlighter1_56_58_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;MyClass&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">()</span><span id=Codehighlighter1_56_58_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_56_58_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_80_224_Open_Image onclick="this.style.display='none'; Codehighlighter1_80_224_Open_Text.style.display='none'; Codehighlighter1_80_224_Closed_Image.style.display='inline'; Codehighlighter1_80_224_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_80_224_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_80_224_Closed_Text.style.display='none'; Codehighlighter1_80_224_Open_Image.style.display='inline'; Codehighlighter1_80_224_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>MyClass.prototype&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span id=Codehighlighter1_80_224_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_80_224_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;_name:&nbsp;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">,<br><img id=Codehighlighter1_123_156_Open_Image onclick="this.style.display='none'; Codehighlighter1_123_156_Open_Text.style.display='none'; Codehighlighter1_123_156_Closed_Image.style.display='inline'; Codehighlighter1_123_156_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_123_156_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_123_156_Closed_Text.style.display='none'; Codehighlighter1_123_156_Open_Image.style.display='inline'; Codehighlighter1_123_156_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;get_name:&nbsp;</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">()</span><span id=Codehighlighter1_123_156_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_123_156_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">,<br><img id=Codehighlighter1_188_222_Open_Image onclick="this.style.display='none'; Codehighlighter1_188_222_Open_Text.style.display='none'; Codehighlighter1_188_222_Closed_Image.style.display='inline'; Codehighlighter1_188_222_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_188_222_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_188_222_Closed_Text.style.display='none'; Codehighlighter1_188_222_Open_Image.style.display='inline'; Codehighlighter1_188_222_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;set_name:&nbsp;</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">(value)</span><span id=Codehighlighter1_188_222_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_188_222_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">._name&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;value;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><br><img id=Codehighlighter1_272_520_Open_Image onclick="this.style.display='none'; Codehighlighter1_272_520_Open_Text.style.display='none'; Codehighlighter1_272_520_Closed_Image.style.display='inline'; Codehighlighter1_272_520_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_272_520_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_272_520_Closed_Text.style.display='none'; Codehighlighter1_272_520_Open_Image.style.display='inline'; Codehighlighter1_272_520_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">&nbsp;setProperties(component,&nbsp;properties)</span><span id=Codehighlighter1_272_520_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_272_520_Open_Text><span style="COLOR: #000000">{<br><img id=Codehighlighter1_307_514_Open_Image onclick="this.style.display='none'; Codehighlighter1_307_514_Open_Text.style.display='none'; Codehighlighter1_307_514_Closed_Image.style.display='inline'; Codehighlighter1_307_514_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_307_514_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_307_514_Closed_Text.style.display='none'; Codehighlighter1_307_514_Open_Image.style.display='inline'; Codehighlighter1_307_514_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;name&nbsp;</span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;properties)&nbsp;</span><span id=Codehighlighter1_307_514_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_307_514_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;val&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;properties[name];<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;setter&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;component[</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">set_</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;name];<br><img id=Codehighlighter1_435_501_Open_Image onclick="this.style.display='none'; Codehighlighter1_435_501_Open_Text.style.display='none'; Codehighlighter1_435_501_Closed_Image.style.display='inline'; Codehighlighter1_435_501_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_435_501_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_435_501_Closed_Text.style.display='none'; Codehighlighter1_435_501_Open_Image.style.display='inline'; Codehighlighter1_435_501_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #0000ff">typeof</span><span style="COLOR: #000000">(setter)&nbsp;</span><span style="COLOR: #000000">===</span><span style="COLOR: #000000">&nbsp;'</span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">')&nbsp;</span><span id=Codehighlighter1_435_501_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_435_501_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setter.apply(component,&nbsp;[val]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">var</span><span style="COLOR: #000000">&nbsp;m&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;MyClass();<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><br><img id=Codehighlighter1_563_578_Open_Image onclick="this.style.display='none'; Codehighlighter1_563_578_Open_Text.style.display='none'; Codehighlighter1_563_578_Closed_Image.style.display='inline'; Codehighlighter1_563_578_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_563_578_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_563_578_Closed_Text.style.display='none'; Codehighlighter1_563_578_Open_Image.style.display='inline'; Codehighlighter1_563_578_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>setProperties(m,</span><span id=Codehighlighter1_563_578_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.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_563_578_Open_Text><span style="COLOR: #000000">{name:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">fanrong</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">}</span></span><span style="COLOR: #000000">);<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>alert(m.get_name());<br><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">script</span><span style="COLOR: #000000">&gt;</span></div>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img src ="http://www.cnblogs.com/fanrong/aggbug/790185.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43810/" target="_blank">[新闻]微软官方下载：Windows Vista SP2 Beta测试版</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>jQuery简析</title><link>http://www.cnblogs.com/fanrong/archive/2007/05/28/763025.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Mon, 28 May 2007 13:34:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/05/28/763025.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/763025.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/05/28/763025.html#Feedback</comments><slash:comments>16</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/763025.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/763025.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jQuery的开篇声明里有一段非常重要的话:<STRONG><FONT color=#0000ff>jQuery是为了改变javascript的编码方式而设计的</FONT></STRONG>.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从这段话可以看出jQuery本身并不是UI组件库或其他的一般AJAX类库.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG><FONT color=#0000ff>jQuery改变javascript编码方式!</FONT></STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;那么它是如何实现它的声明的呢?这里,用以下的一段简短的使用流程:<BR><STRONG><FONT color=#0000ff>1)查找(创建)jQuery对象</FONT></STRONG>:$("selector");<BR><STRONG><FONT color=#0000ff>2)调用jQuery对象的方法完成我们需要完成的工作</FONT></STRONG>:$("selector").doOurWork();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ok,jQuery就是以这种可以说是最简单的编码逻辑来改变javascript编码方式的.这两个步骤是jQuery的编码逻辑核心!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;要实现这种简洁编码方式,创建jQuery对象这一环节至关重要.因此,jQuery的<STRONG><FONT color=#0000ff>dom元素查找能力</FONT></STRONG>相当强悍.此外,jQuery对象的方法肯定是有限的,有限的方法满足不了日益增长各有所需的要求,所以,必须提供<STRONG><FONT style="BACKGROUND-COLOR: #ffffff" color=#0000ff>jQuery对象方法的扩展</FONT></STRONG>能力.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;强悍的dom元素查找能力,以及随心所欲的方法扩展,这两点正是jQuery的核心所在!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;来一个简单的示例,来说明jQuery是如何工作的:<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; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Transitional//EN"&nbsp;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html&nbsp;</SPAN><SPAN style="COLOR: #ff0000">xmlns</SPAN><SPAN style="COLOR: #0000ff">="http://www.w3.org/1999/xhtml"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">无标题页</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">body&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="bd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">a&nbsp;</SPAN><SPAN style="COLOR: #ff0000">href</SPAN><SPAN style="COLOR: #0000ff">="http://www.baidu.com"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">baidu</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">a</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">script&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text/javascript"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;src</SPAN><SPAN style="COLOR: #0000ff">="../Script/jquery.js"</SPAN><SPAN style="COLOR: #0000ff">&gt;&lt;/</SPAN><SPAN style="COLOR: #800000">script</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_377_535_Open_Image onclick="this.style.display='none'; Codehighlighter1_377_535_Open_Text.style.display='none'; Codehighlighter1_377_535_Closed_Image.style.display='inline'; Codehighlighter1_377_535_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_377_535_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_377_535_Closed_Text.style.display='none'; Codehighlighter1_377_535_Open_Image.style.display='inline'; Codehighlighter1_377_535_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">script&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text/javascript"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN id=Codehighlighter1_377_535_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_377_535_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG id=Codehighlighter1_390_532_Open_Image onclick="this.style.display='none'; Codehighlighter1_390_532_Open_Text.style.display='none'; Codehighlighter1_390_532_Closed_Image.style.display='inline'; Codehighlighter1_390_532_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_390_532_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_390_532_Closed_Text.style.display='none'; Codehighlighter1_390_532_Open_Image.style.display='inline'; Codehighlighter1_390_532_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>$(</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">()</SPAN><SPAN id=Codehighlighter1_390_532_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_390_532_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG id=Codehighlighter1_420_528_Open_Image onclick="this.style.display='none'; Codehighlighter1_420_528_Open_Text.style.display='none'; Codehighlighter1_420_528_Closed_Image.style.display='inline'; Codehighlighter1_420_528_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_420_528_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_420_528_Closed_Text.style.display='none'; Codehighlighter1_420_528_Open_Image.style.display='inline'; Codehighlighter1_420_528_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;$(</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">a</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).click(</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(e)</SPAN><SPAN id=Codehighlighter1_420_528_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_420_528_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">1)查找$("a");2)jQuery对象事件click;3)jQuery对象方法hide</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).hide(</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">slow</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">false</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">script</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jQuery中有一个"配置"的思想,这一点使得对象的属性/事件等设置变得容易理解且十分简便,如下一个拖拽组件的初始化:<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; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">$(document).ready(<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">()<BR><IMG id=Codehighlighter1_32_219_Open_Image onclick="this.style.display='none'; Codehighlighter1_32_219_Open_Text.style.display='none'; Codehighlighter1_32_219_Closed_Image.style.display='inline'; Codehighlighter1_32_219_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_32_219_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_32_219_Closed_Text.style.display='none'; Codehighlighter1_32_219_Open_Image.style.display='inline'; Codehighlighter1_32_219_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_32_219_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_32_219_Open_Text><SPAN style="COLOR: #000000">{</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_114_214_Open_Image onclick="this.style.display='none'; Codehighlighter1_114_214_Open_Text.style.display='none'; Codehighlighter1_114_214_Closed_Image.style.display='inline'; Codehighlighter1_114_214_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_114_214_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_114_214_Closed_Text.style.display='none'; Codehighlighter1_114_214_Open_Image.style.display='inline'; Codehighlighter1_114_214_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$('#drag1').Draggable(</SPAN><SPAN id=Codehighlighter1_114_214_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_114_214_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handle:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ax</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">属性设置</SPAN><SPAN style="COLOR: #008000"><BR><IMG id=Codehighlighter1_188_210_Open_Image onclick="this.style.display='none'; Codehighlighter1_188_210_Open_Text.style.display='none'; Codehighlighter1_188_210_Closed_Image.style.display='inline'; Codehighlighter1_188_210_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_188_210_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_188_210_Closed_Text.style.display='none'; Codehighlighter1_188_210_Open_Image.style.display='inline'; Codehighlighter1_188_210_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;onStart:&nbsp;</SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">(el,x,y)</SPAN><SPAN id=Codehighlighter1_188_210_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_188_210_Open_Text><SPAN style="COLOR: #000000">{&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">事件监听器设置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>);</SPAN></DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以看到,$("#drag1")是查找并创建一个jquery对象,然后调用Draggable方法进行拖拽初始化,在此方法调用时,传递一个"配置"对象,进行拖拽操作的初始化配置.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这一"配置"的思想,极大简化了一些编码步骤,并相当直观和易懂.<BR><BR>以下我进行三个问答:<BR>1)&nbsp;&nbsp;&nbsp;问:为什么$(selector)之后,返回的是jQuery对象?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;答:从jQuery的源代码中,我们可以知道:var $ = jQuery.因此当我们$(selector)操作时,其实就是jQuery(selector),创建的是一个jQuery对象.当然正确的写法应该是这样的:var jq&nbsp;= new $(selector);而jQuery使用了一个小技巧在外部避免了new,在jquery方法内部:if ( window == this ) return new jQuery(selector);<BR>2)&nbsp;&nbsp;&nbsp;问:为什么创建一个jQuery对象之后,我们可以这样写$(selector).each(function(index){...});进行遍历操作呢?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;答:其实jQuery(selector)方法调用时,在jQuery(selector)方法内部,最后返回的是一个数组:return&nbsp;this.setArray(a);而each方法体内部是一个for循环,在循环体内是这样调用的:method.call(this[i],i).<BR>3)&nbsp;&nbsp;&nbsp;问:为什么jQuery能做到jQuery对象属性/方法/事件的插件式扩展?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;答:如果您有一些javasciprt的面向对象方面的知识,就会知道,jQuery.prototype原型对象上的扩展属性/方法和事件,将会给jQuery的对象"扩展".基于这一点,jQuery是这样写的:jQuery.fn = jQuery.prototype.所以,当我们扩展一个插件功能时,如下:<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; BACKGROUND-COLOR: #eeeeee"><IMG id=Codehighlighter1_29_94_Open_Image onclick="this.style.display='none'; Codehighlighter1_29_94_Open_Text.style.display='none'; Codehighlighter1_29_94_Closed_Image.style.display='inline'; Codehighlighter1_29_94_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_29_94_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_29_94_Closed_Text.style.display='none'; Codehighlighter1_29_94_Open_Image.style.display='inline'; Codehighlighter1_29_94_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">jQuery.fn.check&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">()&nbsp;</SPAN><SPAN id=Codehighlighter1_29_94_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_29_94_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_61_90_Open_Image onclick="this.style.display='none'; Codehighlighter1_61_90_Open_Text.style.display='none'; Codehighlighter1_61_90_Closed_Image.style.display='inline'; Codehighlighter1_61_90_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_61_90_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_61_90_Closed_Text.style.display='none'; Codehighlighter1_61_90_Open_Image.style.display='inline'; Codehighlighter1_61_90_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.each(</SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">()&nbsp;</SPAN><SPAN id=Codehighlighter1_61_90_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_61_90_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.checked&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV>其实就是: 
<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; BACKGROUND-COLOR: #eeeeee"><IMG id=Codehighlighter1_36_101_Open_Image onclick="this.style.display='none'; Codehighlighter1_36_101_Open_Text.style.display='none'; Codehighlighter1_36_101_Closed_Image.style.display='inline'; Codehighlighter1_36_101_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_36_101_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_36_101_Closed_Text.style.display='none'; Codehighlighter1_36_101_Open_Image.style.display='inline'; Codehighlighter1_36_101_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">jQuery.prototype.check&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">()&nbsp;</SPAN><SPAN id=Codehighlighter1_36_101_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_36_101_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_68_97_Open_Image onclick="this.style.display='none'; Codehighlighter1_68_97_Open_Text.style.display='none'; Codehighlighter1_68_97_Closed_Image.style.display='inline'; Codehighlighter1_68_97_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_68_97_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_68_97_Closed_Text.style.display='none'; Codehighlighter1_68_97_Open_Image.style.display='inline'; Codehighlighter1_68_97_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.each(</SPAN><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">()&nbsp;</SPAN><SPAN id=Codehighlighter1_68_97_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_68_97_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.checked&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;综上所述,jQuery给我们带来了<FONT color=#0000ff><FONT color=#000000>一个</FONT><STRONG>简洁方便的编码模型</STRONG></FONT>(1&gt;创建jQuery对象;2&gt;直接使用jQuery对象的属性/方法/事件),一个<STRONG><FONT color=#0000ff>强悍的dom元素查找器</FONT></STRONG>($),<STRONG><FONT color=#0000ff>插件式编程接口</FONT></STRONG>(jQuery.fn),以及插件初始化的"配置"对象思想.<BR><BR>&nbsp;&nbsp;&nbsp;附:实现自己的jQuery</P>
<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; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;"-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Transitional//EN"&nbsp;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html&nbsp;</SPAN><SPAN style="COLOR: #ff0000">xmlns</SPAN><SPAN style="COLOR: #0000ff">="http://www.w3.org/1999/xhtml"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">Untitled&nbsp;Page</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">div&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="d"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">divvv</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">div</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">div&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="fsd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">fdsf</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">div</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_318_1084_Open_Image onclick="this.style.display='none'; Codehighlighter1_318_1084_Open_Text.style.display='none'; Codehighlighter1_318_1084_Closed_Image.style.display='inline'; Codehighlighter1_318_1084_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_318_1084_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_318_1084_Closed_Text.style.display='none'; Codehighlighter1_318_1084_Open_Image.style.display='inline'; Codehighlighter1_318_1084_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">script&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text/javascript"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN id=Codehighlighter1_318_1084_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_318_1084_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">实现自己的MyQuery框架</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG id=Codehighlighter1_368_632_Open_Image onclick="this.style.display='none'; Codehighlighter1_368_632_Open_Text.style.display='none'; Codehighlighter1_368_632_Closed_Image.style.display='inline'; Codehighlighter1_368_632_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_368_632_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_368_632_Closed_Text.style.display='none'; Codehighlighter1_368_632_Open_Image.style.display='inline'; Codehighlighter1_368_632_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;MyQuery&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(selector)</SPAN><SPAN id=Codehighlighter1_368_632_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_368_632_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;(&nbsp;window&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;)&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">new</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;MyQuery(selector);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">这里只实现dom类型的简单查找,嘿嘿</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;doms&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;document.getElementsByTagName(selector);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;arr&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;[];<BR><IMG id=Codehighlighter1_561_599_Open_Image onclick="this.style.display='none'; Codehighlighter1_561_599_Open_Text.style.display='none'; Codehighlighter1_561_599_Closed_Image.style.display='inline'; Codehighlighter1_561_599_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_561_599_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_561_599_Closed_Text.style.display='none'; Codehighlighter1_561_599_Open_Image.style.display='inline'; Codehighlighter1_561_599_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">for</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;i</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;&nbsp;i</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">doms.length;&nbsp;i</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">++</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)</SPAN><SPAN id=Codehighlighter1_561_599_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_561_599_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arr.push(doms.item(i));<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">.setArray(arr);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG id=Codehighlighter1_679_745_Open_Image onclick="this.style.display='none'; Codehighlighter1_679_745_Open_Text.style.display='none'; Codehighlighter1_679_745_Closed_Image.style.display='inline'; Codehighlighter1_679_745_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_679_745_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_679_745_Closed_Text.style.display='none'; Codehighlighter1_679_745_Open_Image.style.display='inline'; Codehighlighter1_679_745_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>MyQuery.prototype.setArray&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(&nbsp;arr&nbsp;)&nbsp;</SPAN><SPAN id=Codehighlighter1_679_745_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_679_745_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">.length&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[].push.apply(&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">,&nbsp;arr&nbsp;);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">return</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>MyQuery.fn&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;MyQuery.prototype;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;$&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;MyQuery;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">插件扩展1)each</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG id=Codehighlighter1_844_926_Open_Image onclick="this.style.display='none'; Codehighlighter1_844_926_Open_Text.style.display='none'; Codehighlighter1_844_926_Closed_Image.style.display='inline'; Codehighlighter1_844_926_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_844_926_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_844_926_Closed_Text.style.display='none'; Codehighlighter1_844_926_Open_Image.style.display='inline'; Codehighlighter1_844_926_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">MyQuery.fn.each&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(method)</SPAN><SPAN id=Codehighlighter1_844_926_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_844_926_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG id=Codehighlighter1_886_924_Open_Image onclick="this.style.display='none'; Codehighlighter1_886_924_Open_Text.style.display='none'; Codehighlighter1_886_924_Closed_Image.style.display='inline'; Codehighlighter1_886_924_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_886_924_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_886_924_Closed_Text.style.display='none'; Codehighlighter1_886_924_Open_Image.style.display='inline'; Codehighlighter1_886_924_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">for</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;i</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">,l</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">.length;&nbsp;i</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&lt;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">l;&nbsp;i</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">++</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">)</SPAN><SPAN id=Codehighlighter1_886_924_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_886_924_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;method.call(</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">[i],i);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">插件扩展2)show</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG id=Codehighlighter1_969_1055_Open_Image onclick="this.style.display='none'; Codehighlighter1_969_1055_Open_Text.style.display='none'; Codehighlighter1_969_1055_Closed_Image.style.display='inline'; Codehighlighter1_969_1055_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_969_1055_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_969_1055_Closed_Text.style.display='none'; Codehighlighter1_969_1055_Open_Image.style.display='inline'; Codehighlighter1_969_1055_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">MyQuery.fn.show&nbsp;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">()</SPAN><SPAN id=Codehighlighter1_969_1055_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_969_1055_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG id=Codehighlighter1_996_1051_Open_Image onclick="this.style.display='none'; Codehighlighter1_996_1051_Open_Text.style.display='none'; Codehighlighter1_996_1051_Closed_Image.style.display='inline'; Codehighlighter1_996_1051_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_996_1051_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_996_1051_Closed_Text.style.display='none'; Codehighlighter1_996_1051_Open_Image.style.display='inline'; Codehighlighter1_996_1051_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">.each(</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(i)</SPAN><SPAN id=Codehighlighter1_996_1051_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_996_1051_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(i</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">.id</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">this</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">.innerHTML);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">//</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5">debugger</SPAN><SPAN style="COLOR: #008000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">$(</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">div</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).show();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">script</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV><img src ="http://www.cnblogs.com/fanrong/aggbug/763025.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43809/" target="_blank">[新闻]微软发布PC Live单机游戏客户端</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>我的Ajax Framework的架构设计思路</title><link>http://www.cnblogs.com/fanrong/archive/2007/05/22/755881.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Tue, 22 May 2007 09:16:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/05/22/755881.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/755881.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/05/22/755881.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/755881.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/755881.html</trackback:ping><description><![CDATA[<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;核心思想:分层设计,组件化编程.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客户端AJAX框架分4层:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1)核心级:提供一套最基本的跨浏览器属性和方法.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2)系统级:具备完整的ajax框架特点.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3)应用级:提供丰富的UI组件库.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4)业务级:提供针对具体业务需求而开发的UI组件库.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG><FONT color=#0000ff>核心级</FONT>:以Helper模式提供跨浏览器方法/事件/对象,不对原始浏览器做任何改动.</STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&gt;基础javascript扩展<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&gt;跨浏览器的window对象,DomHelper(提供跨浏览器DOM操作),EventHelper(提供跨浏览器事件机制),XMLDOM,XMLHttpRequest,CssHelper(样式操作)...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&gt;一些基本UI组件:combobox,colorSelector,calendar等<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;核心级框架可以被任何人使用,它只提供最基本的跨浏览器对象,不具备任何"框架性"特征,和原始的HTML和JAVASCRIPT是一个层级的.它的意义就在于"跨浏览器"!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG><FONT color=#0000ff>系统级</FONT>:提供一个完善的Ajax框架,实现面向对象方式的组件封装和实现组件化编程的架构.<BR></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&gt;面向对象框架<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&gt;运行时环境对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&gt;事件机制<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4&gt;组件模型<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5&gt;JSON组件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&gt;网络通信组件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7&gt;DragDrop拖拽组件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8&gt;动作组件,动画组件,数据组件等..<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9&gt;js动态加载组件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本层实现类似vasp.net ajax Extensions,做的都是一些"基础性"的工作,完成基础架构,担没有直接可以应用的UI组件.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG><FONT color=#0000ff>应用级:</FONT>提供可直接应用的与具体业务需求无关的UI组件库.<BR></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如:grid,tree,menu,tabpanel,toolbar等...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本层以<STRONG>"插件"</STRONG>形式提供专业的UI组件库,可以说这一层是UI级的AJAX,也是最实用的一层.本层的编码设计依赖于系统级的框架设计,实现组件的装配和拆分.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG><FONT color=#0000ff>业务级</FONT>:针对具体业务需求而开发的UI组件库<BR></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如:一个具有完整流程的类Excel操作的扩展Grid,一个从固定XML结构格式生成的Menu或Tree等.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这一层级与具体业务需求紧密关联,这一层的应用不需要写代码,而应该封装在JAVA标签或.NET WEB控件内.应用组件的开发人员,应该只需要配置几个属性,提供一个符合需要的数据源对象即可使用此层的组件.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;组件化架构:借鉴微软的asp.net ajax的OO框架和组件化框架.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&gt;<FONT color=#0000ff><STRONG>组件之间的分离与组合</STRONG></FONT>.依靠接口和抽象基类进行分离设计,实现关键功能部件的颗粒化细分.分离和组件,这事两大设计要点!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&gt;<FONT color=#0000ff><STRONG>组件的逻辑功能与界面特效功能的分离与绑定</STRONG></FONT>.如将基础UI控件,动作组件,动画组件等进行分离和绑定.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&gt;<FONT style="BACKGROUND-COLOR: #ffffff" color=#0000ff><STRONG>组件的基础样式和可扩展样式的分离</STRONG></FONT>.必须将一个UI组件的基本base样式和可扩展ext样式进行分离设计,而不要耦合在一起,让其他应用者难以进行样式修改和皮肤扩展(YUI-EXT就是这样的情况).<BR><BR>&nbsp;&nbsp;&nbsp;实现以上不同层级的框架开发之后,可以应用在任何软件平台上,设计RIA的UI控件,如java的标签,.net的web control等...</P><img src ="http://www.cnblogs.com/fanrong/aggbug/755881.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43808/" target="_blank">[新闻]Firefox遭“独家”恶意软件攻击</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>jQuery学习资源</title><link>http://www.cnblogs.com/fanrong/archive/2007/05/22/755821.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Tue, 22 May 2007 08:34:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/05/22/755821.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/755821.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/05/22/755821.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/755821.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/755821.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT style="BACKGROUND-COLOR: #ffffff">&nbsp;<FONT color=#0000ff>jQuery官方主页:</FONT></FONT><A href="http://jquery.com">http://jquery.com</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#0000ff>jQuery中文入门指南</FONT>:<A href="http://www.k99k.com/jQuery_getting_started.html">http://www.k99k.com/jQuery_getting_started.html</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#000080><FONT color=#0000ff>jQuery使用手册</FONT>:<A href="/skylaugh/archive/2006/12/18/595563.html">http://www.cnblogs.com/skylaugh/archive/2006/12/18/595563.html</A></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#0000ff>jQuery UI插件演示</FONT>:<A href="http://interface.eyecon.ro/demos">http://interface.eyecon.ro/demos</A><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#0000ff>jQuery插件</FONT>:<FONT style="BACKGROUND-COLOR: #ffffff"><A href="http://docs.jquery.com/Plugins">http://docs.jquery.com/Plugins</A></FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#0000ff>jQuery API 中文版</FONT>:<A href="http://jquery.org.cn/api/cn/index.xml">http://jquery.org.cn/api/cn/index.xml<BR></A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class=bold><FONT color=#0000ff>jQuery 中文官方论坛</FONT>:<A href="http://bbs.jquery.org.cn/">http://bbs.jquery.org.cn/</A><BR><FONT color=#000080>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><img src ="http://www.cnblogs.com/fanrong/aggbug/755821.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43808/" target="_blank">[新闻]Firefox遭“独家”恶意软件攻击</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>asp.net ajax的事件机制小议</title><link>http://www.cnblogs.com/fanrong/archive/2007/04/27/729875.html</link><dc:creator>沧桑雨迢迢</dc:creator><author>沧桑雨迢迢</author><pubDate>Fri, 27 Apr 2007 07:30:00 GMT</pubDate><guid>http://www.cnblogs.com/fanrong/archive/2007/04/27/729875.html</guid><wfw:comment>http://www.cnblogs.com/fanrong/comments/729875.html</wfw:comment><comments>http://www.cnblogs.com/fanrong/archive/2007/04/27/729875.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/fanrong/comments/commentRss/729875.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/fanrong/services/trackbacks/729875.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Asp.net Ajax提供的Sys.UI.DomEvent类,实现了跨浏览器的Dom事件操作,诸如以下几个常用的事件操作:$addHandler,$removeHandler,$addHandlers,$clearHandlers.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;举一个简单的使用示例:<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; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html&nbsp;</SPAN><SPAN style="COLOR: #ff0000">xmlns</SPAN><SPAN style="COLOR: #0000ff">="http://www.w3.org/1999/xhtml"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head&nbsp;</SPAN><SPAN style="COLOR: #ff0000">runat</SPAN><SPAN style="COLOR: #0000ff">="server"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">无标题页</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">form&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="form1"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;runat</SPAN><SPAN style="COLOR: #0000ff">="server"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">asp:ScriptManager&nbsp;</SPAN><SPAN style="COLOR: #ff0000">ID</SPAN><SPAN style="COLOR: #0000ff">="ScriptManager1"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;runat</SPAN><SPAN style="COLOR: #0000ff">="server"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">asp:ScriptManager</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">div</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="Button1"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="button"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="button"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">input&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="txt1"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="text"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">div</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">form</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_415_662_Open_Image onclick="this.style.display='none'; Codehighlighter1_415_662_Open_Text.style.display='none'; Codehighlighter1_415_662_Closed_Image.style.display='inline'; Codehighlighter1_415_662_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_415_662_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_415_662_Closed_Text.style.display='none'; Codehighlighter1_415_662_Open_Image.style.display='inline'; Codehighlighter1_415_662_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">script&nbsp;</SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text/javascript"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN id=Codehighlighter1_415_662_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_415_662_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG id=Codehighlighter1_435_661_Open_Image onclick="this.style.display='none'; Codehighlighter1_435_661_Open_Text.style.display='none'; Codehighlighter1_435_661_Closed_Image.style.display='inline'; Codehighlighter1_435_661_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_435_661_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_435_661_Closed_Text.style.display='none'; Codehighlighter1_435_661_Open_Image.style.display='inline'; Codehighlighter1_435_661_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;pageLoad()</SPAN><SPAN id=Codehighlighter1_435_661_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_435_661_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG id=Codehighlighter1_481_527_Open_Image onclick="this.style.display='none'; Codehighlighter1_481_527_Open_Text.style.display='none'; Codehighlighter1_481_527_Closed_Image.style.display='inline'; Codehighlighter1_481_527_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_481_527_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_481_527_Closed_Text.style.display='none'; Codehighlighter1_481_527_Open_Image.style.display='inline'; Codehighlighter1_481_527_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;$addHandler(document,</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">click</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">,</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(e)</SPAN><SPAN id=Codehighlighter1_481_527_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_481_527_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(e.clientX</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">:</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">+</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">e.clientY);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG id=Codehighlighter1_587_657_Open_Image onclick="this.style.display='none'; Codehighlighter1_587_657_Open_Text.style.display='none'; Codehighlighter1_587_657_Closed_Image.style.display='inline'; Codehighlighter1_587_657_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_587_657_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_587_657_Closed_Text.style.display='none'; Codehighlighter1_587_657_Open_Image.style.display='inline'; Codehighlighter1_587_657_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;$addHandler($get(</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Button1</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">),</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">click</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">,</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(e)</SPAN><SPAN id=Codehighlighter1_587_657_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.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_587_657_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert($get(</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">txt1</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">).value);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.stopPropagation();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">script</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以看见,通过$addHandler对一个DOM元素进行事件监听时,事件处理方法会传递进来一个默认的e参数,这一点和IE的全局的event对象的做法不同,而更符合标准的做法.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注意,这个e参数就是事件对象,而且是一个跨浏览器的事件对象,它具有如:target,clientX,clientY,keyCode,type...等常用的属性.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;此外,这个DOM事件e对象,有两个比较重要的方法:preventDefault(阻止浏览器DOM元素的默认行为),stopPropagation(阻止DOM事件的冒泡传递).利用这两个方法,可以实现一些特别的需