<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_开水房</title><subtitle type="text">ASP.NET</subtitle><id>http://feed.cnblogs.com/blog/u/38259/rss</id><updated>2011-12-15T02:33:38Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><generator>CNBlogs BlogServer</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/38259/rss"/><entry><id>http://www.cnblogs.com/kevinge/archive/2011/12/15/2288483.html</id><title type="text">net start 服务名</title><summary type="text">net start 服务名net stop 服务名</summary><published>2011-12-15T02:34:00Z</published><updated>2011-12-15T02:34:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/12/15/2288483.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/12/15/2288483.html"/><content type="html">&lt;div&gt;net start 服务名&lt;/div&gt;&lt;p&gt;net stop 服务名&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2288483.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/12/15/2288483.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/28/2227618.html</id><title type="text">css absolute relative 定位</title><summary type="text">转自：http://apps.hi.baidu.com/share/detail/11121011例如如下A-B的嵌套结构&amp;lt;div id=&amp;quot;A&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;B&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;当A的position为relative时，B的position为absolute才有效。这时候left:0、top:0就不再针对窗口文 档，而是针对id为A的这个div了。实例演示div+css的绝对定位和相对定位布局说明：占位空间：元素在文档流中所占据的空间。物理空间：元素本身所占据的空间。下面分3种情况分别对相</summary><published>2011-10-28T06:01:00Z</published><updated>2011-10-28T06:01:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/28/2227618.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/28/2227618.html"/><content type="html">&lt;div&gt;转自：&amp;nbsp;&lt;a href="http://apps.hi.baidu.com/share/detail/11121011"&gt;http://apps.hi.baidu.com/share/detail/11121011&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;span style="color: #9a9a9a; font-family: arial; font-size: 12px; line-height: 18px; "&gt;例如如下A-B的嵌套结构&lt;div style="word-wrap: break-word; "&gt;&amp;lt;div id="A"&amp;gt;&lt;br /&gt;&amp;lt;div id="B"&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;当A的position为relative时，B的position为absolute才有效。这时候left:0、top:0就不再针对窗口文 档，而是针对id为A的这个div了。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;实例演示div+css的绝对定位和相对定位布局&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;说明：&lt;/strong&gt;&lt;br /&gt;占位空间：元素在文档流中所占据的空间。&lt;br /&gt;物理空间：元素本身所占据的空间。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;下面分3种情况分别对相对定位和绝对定位进行讨论：&lt;br /&gt;1.只使用css第一组属性布局定位元素的情况&lt;br /&gt;2.只使用css第二组属性布局定位元素的情况&lt;br /&gt;3.混合使用第一组和第二组属性的情况&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;图1为未定位时的初始效果，&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box2&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="314" width="191" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/be096b63b572655e0c33faf0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图1&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;一、用相对定位布局块级元素&lt;/strong&gt;&lt;br /&gt;元素设置position值： position:relative&lt;br /&gt;此属性值的设置，元素没有脱离文档流，还是普通流定位模型的一部分，会对文档流中其它元素布局产生影响。（说明：蓝色代表占位空间，红色代表元素）&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;1.仅使用left、right、top和bottom属性布局相对定位元素的情况&lt;/strong&gt;&lt;br /&gt;元素原本所占的占位空间仍保留，物理空间偏移。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;图2中，设置元素的left和top的值，对box2进行布局，可以发现除了box2偏移之外，其他块级元素的位置没有被影响，可见box2的占位空间还是存在的。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211; position:relative ; top:-60px; left:80px;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="314" width="191" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/6c81800ab18eb200b1351df0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图2&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;2.仅使用margin属性布局相对定位元素的情况&lt;/strong&gt;&lt;br /&gt;用margin-bottom属性和margin-top属性设置负值可以改变文档流中所占空间的高度，会影响文档流中的其它元素位置。例如：margin-top:负值; margin-bottom:负值&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;图3中，box1和box2都设置了元素margin-bottom的值，值等于它们高度的负值。box1和box2物理空间没有改变，占位空间高度为0。box3的margin-bottom值设置为0，物理空间没有改变，占位空间高度不变。再通过margin-left对box2和box3设置左偏移值。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box1 &amp;#8212;&amp;#8212;&amp;#8211; position:relative ; margin-bottom:-102px;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211; position:relative ; margin-bottom:-102px; margin-left:110px;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box3 &amp;#8212;&amp;#8212;&amp;#8211; position:relative ; margin-bottom:0px; margin-left:220px;&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="234" width="423" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/19d8bc3e1b633dc4828b13f0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图3&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;3.混合使用left、right、top和bottom属性与margin属性布局相对定位元素的情况&lt;/strong&gt;&lt;br /&gt;此情况，它们的值会产生累加的效果。在CSS2.1中所有的浏览器都使用外边距边界来完成 偏移计算。本文从数学的角度理解为偏移属性值和外边距属性值累加。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;图4中，box2是在图3的基础上增加设置left的值产生的效果，可见margin-left的值和left的值产生了累加。(偏移量:80px = 110px - 30px)&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box1 &amp;#8212;&amp;#8212;- position:relative ; margin-bottom:-102px;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;- position:relative ; margin-bottom:-102px;margin-left:110px; flet:-30px;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div box3 &amp;#8212;&amp;#8212;- position:relative ; margin-bottom:0px; margin-left:220px;&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="234" width="423" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/0c338744acae1472510ffef0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图4&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;二、用绝对定位布局块级元素&lt;/strong&gt;&lt;br /&gt;设置position值：position:absolute;&lt;br /&gt;此属性值的设置，元素从文档流完全删除。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;1.仅使用left、right、top和bottom属性布局绝对定位元素的情况&lt;/strong&gt;&lt;br /&gt;绝对定位的元素的偏移位置以最近的定位(包括相对定位和绝对定位)祖先元素作参照物。如果元素没有已定位(包括相对定位和绝对定位)的祖先元素，那么它的参照物为最顶级元素（由于浏览器的默认参照物不同，物可能是BODY或 HTML 元素）。&lt;br /&gt;注意：IE下参照物需设置宽度或高度bottom和right属性才可以正确的定位。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;设置元素为绝对定位元素后，元素的Left、 Right、Top和Bottom属性默认值不是0，只是将元素脱离文档流。以下例子说明这个问题。&lt;br /&gt;在图5中，将橘黄色的祖先元素设置为定位元素（即参照物），box2设为绝对定位，文档流由box1-box2-box3变为box1-box3，可box2却没有移动到距离参照物0值的位置上，可见box2的Left、 Right、Top和Bottom属性默认值不等于0，它只是脱离了文档流而已。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;position:relative 参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211;absolute&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="308" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/b13533fa2edda820a8d311f0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图5&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;以最近的祖先定位元素为参照物的情况&lt;/strong&gt;&lt;br /&gt;图6中，Box2设置成绝对定位元素，脱离了文档流，文档流由box1-box2-box3变为box1-box3，box2以最近的定位祖先（蓝色框）为参照物。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; position:relative; 不是最近的祖先定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;- position:relative 参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211;position:absolute; top:50px; left:120px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="308" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/ebf81a4c1859d7c7d72afcf0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图6&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;图7中，为改变参照物（橘色框）后的效果&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; position:relative;最近的祖先定位元素，参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211;position:absolute; top:50px; left:120px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="308" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/828ba61e0685f321413417f0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图7&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;图8中，&lt;strong&gt;参照物为最顶级的元素情况&lt;/strong&gt;。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211;position:absolute; top:50px; left:120px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="308" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/510fd9f99c7c6e67252df2f0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图8&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;2.仅使用margin属性布局绝对定位元素的情况&lt;/strong&gt;&lt;br /&gt;此情况，margin-bottom 和margin-right的值不再对文档流中的元素产生影响，因为该元素已经脱离了文档流。另外，不管它的祖先元素有没有定位，都是以文档流中原来所在的位置上偏移参照物。&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;图9中，使用margin属性布局相对定位元素。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; position:relative; 不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211;position:absolute; margin-top:50px; margin-left:120px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="326" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/a8d3fd1ff1629934304e15f0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图9&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;IE6的情况下，box2前面没有兄弟节点，则margin-left的值会出现双倍边距，见图10。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212; position:relative; 不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-没有设置为定位元素，不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8211;position:absolute; margin-top:50px; margin-left:60px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="311" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/d72a6059687bda142834f0f0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图10&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;3.混合使用left、right、top和bottom属性与margin属性布局相对定位元素的情况&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;a.&lt;/strong&gt;margin属性和top、bottom、left、right属性同时使用，如果同一方向偏移，它们的值会产生累加的效果，见图11。&lt;br /&gt;例如：margin-left:120px; left:-20px; 那么box2的偏移值为120px-20px=100px;&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;position:relative; 参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8212;position:absolute; margin-left:120px; left:-20px; top:50px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="362" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/304e251f219cdff6a78669f0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图11&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;b.&lt;/strong&gt;绝对定位和相对定位的累加加效果不同，如果top、bottom、left、right属性和margin属性偏移的方向相反，top、bottom、left、right属性值有效，反方向的margin属性值无效，见图12。&lt;br /&gt;层级关系为：&lt;br /&gt;&amp;lt;div &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;不是参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;position:relative; 参照物&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box2 &amp;#8212;&amp;#8212;&amp;#8212;position:absolute; margin-left:120px; right:10px; top:50px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div box3&lt;br /&gt;效果图：&lt;br /&gt;&lt;img height="338" width="320" src="http://hiphotos.baidu.com/%E9%D9%D7%D3%E8%D6/pic/item/a786c917c7686937c93d6df0.jpg" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; cursor: pointer; "  alt="" /&gt;&lt;br /&gt;图12&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #6d6d6d; line-height: 26px; "&gt;&lt;strong&gt;总结：&lt;/strong&gt;&lt;/p&gt;&lt;ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; "&gt;相对定位的元素不会脱离文档流，占用文档流的空间，Left; Right; Top和Bottom属性与margin属性混合使用会产生累加效果。&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; "&gt;绝对定位的元素脱离文档流，偏移不影响文档流中的其它元素，Left; Right; Top和Bottom属性与margin属性混合使用，偏移方向相同值累加，方向相反，margin属性值无效。&lt;/li&gt;&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: initial; list-style-position: initial; list-style-type: none; "&gt;绝对定位的元素以最近的定位祖先元素为参照物。&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2227618.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/28/2227618.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/28/2227275.html</id><title type="text">转： css  针对IE6，IE7，firefox显示不同效果 星号  !important  下划线</title><summary type="text">CSS hack：针对IE6，IE7，firefox显示不同效果做网站时经常会用到，衡量一个DIV+CSS架构师的水平时，这个也很重要。区别不同浏览器的CSS hack写法：区别IE6与FF： background:orange;*background:blue;区别IE6与IE7： background:green !important;background:blue;区别IE7与FF： background:orange; *background:green;区别FF，IE7，IE6： background:orange;*background:green !important;*back</summary><published>2011-10-28T01:35:00Z</published><updated>2011-10-28T01:35:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/28/2227275.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/28/2227275.html"/><content type="html">&lt;div&gt;&lt;span style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 12px; line-height: 18px; "&gt;&lt;strong style="font-weight: bold; "&gt;CSS hack：针对IE6，IE7，firefox显示不同效果&lt;/strong&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;做网站时经常会用到，衡量一个DIV+CSS架构师的水平时，这个也很重要。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;区别不同浏览器的CSS hack写法：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;区别IE6与FF：&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background:orange;*background:blue;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;区别IE6与IE7：&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background:green !important;background:blue;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;区别IE7与FF：&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background:orange; *background:green;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;区别FF，IE7，IE6：&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; background:orange;*background:green !important;*background:blue;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;注：IE都能识别*;标准浏览器(如FF)不能识别*；&amp;nbsp;&lt;br /&gt;&lt;br /&gt;IE6能识别*，但不能识别 !important,&amp;nbsp;&lt;br /&gt;IE7能识别*，也能识别!important;&amp;nbsp;&lt;br /&gt;FF不能识别*，但能识别!important;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IE6 IE7 FF&amp;nbsp;&lt;br /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#8730; &amp;#8730; &amp;#215;&amp;nbsp;&lt;br /&gt;!important &amp;#215; &amp;#8730; &amp;#8730;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------------------------------------&amp;nbsp;&lt;br /&gt;另外再补充一个，下划线"_",&amp;nbsp;&lt;br /&gt;IE6支持下划线，IE7和firefox均不支持下划线。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IE6 IE7 FF&amp;nbsp;&lt;br /&gt;* &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#8730; &amp;#8730; &amp;#215;&amp;nbsp;&lt;br /&gt;!important &amp;#215; &amp;#8730; &amp;#8730;&amp;nbsp;&lt;br /&gt;_ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#8730; &amp;#215; &amp;#215;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;于是大家还可以这样来区分IE6，IE7，firefox&amp;nbsp;&lt;br /&gt;: background:orange;*background:green;_background:blue;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;注：不管是什么方法，书写的顺序都是firefox的写在前面，IE7的写在中间，IE6的写在最后面。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;CSS HACK&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;以下两种方法几乎能解决现今所有HACK.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;1, !important&amp;nbsp;&lt;br /&gt;&lt;br /&gt;随着IE7对!important的支持, !important 方法现在只针对IE6的HACK.(注意写法.记得该声明位置需要提前.)&amp;nbsp;&lt;br /&gt;&amp;lt;stylegt;&amp;nbsp;&lt;br /&gt;#wrapper&amp;nbsp;&lt;br /&gt;{&amp;nbsp;&lt;br /&gt;width: 100px!important; /* IE7+FF */&amp;nbsp;&lt;br /&gt;width: 80px; /* IE6 */&amp;nbsp;&lt;br /&gt;}&amp;nbsp;&lt;br /&gt;&amp;lt;/stylegt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2, IE6/IE77对FireFox&amp;nbsp;&lt;br /&gt;&lt;br /&gt;*+html 与 *html 是IE特有的标签, firefox 暂不支持.而*+html 又为 IE7特有标签.&amp;nbsp;&lt;br /&gt;&amp;lt;style&amp;gt;&amp;nbsp;&lt;br /&gt;#wrapper&amp;nbsp;&lt;br /&gt;{&amp;nbsp;&lt;br /&gt;#wrapper { width: 120px; } /* FireFox */&amp;nbsp;&lt;br /&gt;*html #wrapper { width: 80px;} /* ie6 fixed */&amp;nbsp;&lt;br /&gt;*+html #wrapper { width: 60px;} /* ie7 fixed, 注意顺序 */&amp;nbsp;&lt;br /&gt;}&amp;nbsp;&lt;br /&gt;&amp;lt;/style&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;注意:&amp;nbsp;&lt;br /&gt;*+html 对IE7的HACK 必须保证HTML顶部有如下声明：&amp;nbsp;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"　"http://www.w3.org/TR/html4/loose.dtd"&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;二、万能 float 闭合(非常重要!)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;关于 clear float 的原理可参见 [How To Clear Floats Without Structural Markup]&amp;nbsp;&lt;br /&gt;将以下代码加入Global CSS 中,给需要闭合的div加上 &amp;gt;&amp;lt;style&amp;gt;&amp;nbsp;&lt;br /&gt;/* Clear Fix */&amp;nbsp;&lt;br /&gt;&lt;br /&gt;.clearfix:after&amp;nbsp;&lt;br /&gt;{&amp;nbsp;&lt;br /&gt;content:".";&amp;nbsp;&lt;br /&gt;display:block;&amp;nbsp;&lt;br /&gt;height:0;&amp;nbsp;&lt;br /&gt;clear:both;&amp;nbsp;&lt;br /&gt;visibility:hidden;&amp;nbsp;&lt;br /&gt;}&amp;nbsp;&lt;br /&gt;.clearfix&amp;nbsp;&lt;br /&gt;{&amp;nbsp;&lt;br /&gt;display:inline-block;&amp;nbsp;&lt;br /&gt;}&amp;nbsp;&lt;br /&gt;/* Hide from IE Mac */&amp;nbsp;&lt;br /&gt;.clearfix {display:block;}&amp;nbsp;&lt;br /&gt;/* End hide from IE Mac */&amp;nbsp;&lt;br /&gt;/* end of clearfix */&amp;nbsp;&lt;br /&gt;&amp;lt;/style&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;关于闭合浮动元素（clearing float）的方法现在已经很多了，个人认为简单实用的方法就是使用:after伪类动态的嵌入一个用于清除浮动的元素，可惜代码量太大了，看上去不够简洁。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;现在看到有个方法超级简单。介绍一下这个方法。原文在：http://annevankesteren.nl/2005/03/clearing-floats&amp;nbsp;&lt;br /&gt;&lt;br /&gt;这一方面的原理是，外围元素之所以不能很好的延伸，问题出在了overflow上，因为overflow不可见（见W3C的解释）。现在只要将给外围元素添加一个&amp;#8220;overflow:auto&amp;#8221;，就可以解决问题，结果是除了IE，真的可以解决。下来就要解决ID的问题了，再加上&amp;#8220;_height:1%&amp;#8221;，这个问题就完全解决了。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;下面的例子作为比较&amp;nbsp;&lt;br /&gt;1、没有闭合浮动元素；2、非IE下闭合浮动元素；3、完全闭合元素。相关代码如下：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;XHTML代码：&amp;nbsp;&lt;br /&gt;Example Source Code [ww&amp;nbsp;&lt;br /&gt;w.52css.com]&amp;nbsp;&lt;br /&gt;&amp;lt;div id="wrap"&amp;gt;&amp;nbsp;&lt;br /&gt;&amp;lt;div &amp;gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;h1&amp;gt;Float left&amp;lt;/h1&amp;gt;&amp;nbsp;&lt;br /&gt;&amp;lt;/div&amp;gt;&amp;nbsp;&lt;br /&gt;&amp;lt;div &amp;gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;h1&amp;gt;Float right&amp;lt;/h1&amp;gt;&amp;nbsp;&lt;br /&gt;&amp;lt;/div&amp;gt;&amp;nbsp;&lt;br /&gt;&amp;lt;/div&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CSS样式：&amp;nbsp;&lt;br /&gt;Example Source Code [ww&amp;nbsp;&lt;br /&gt;w.52css.com]&amp;nbsp;&lt;br /&gt;#wrap{ border:6px #ccc solid; overflow:auto; _height:1%;}&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; .column_left{ float:left; width:20%; padding:10px;}&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; .column_right{ float:right; width:75%; padding:10px; border-left:6px #eee solid;}&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;三、其他兼容技巧(再次啰嗦)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;1, FF下给 div 设置 padding 后会导致 width 和 height 增加, 但IE不会.(可用!important解决)&amp;nbsp;&lt;br /&gt;2, 居中问题.&amp;nbsp;&lt;br /&gt;1).垂直居中.将 line-height 设置为 当前 div 相同的高度, 再通过 vertical-align: middle.( 注意内容不要换行.)&amp;nbsp;&lt;br /&gt;2).水平居中. margin: 0 auto;(当然不是万能)&amp;nbsp;&lt;br /&gt;3, 若需给 a 标签内内容加上 样式, 需要设置 display: block;(常见于导航标签)&amp;nbsp;&lt;br /&gt;4, FF 和 IE 对 BOX 理解的差异导致相差 2px 的还有设为 float的div在ie下 margin加倍等问题.&amp;nbsp;&lt;br /&gt;5, ul 标签在 FF 下面默认有 list-style 和 padding . 最好事先声明, 以避免不必要的麻烦. (常见于导航标签和内容列表)&amp;nbsp;&lt;br /&gt;6, 作为外部 wrapper 的 div 不要定死高度, 最好还加上 overflow: hidden.以达到高度自适应.&amp;nbsp;&lt;br /&gt;7, 关于手形光标. cursor: pointer. 而hand 只适用于 IE.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;1 针对firefox ie6 ie7的css样式&amp;nbsp;&lt;br /&gt;现在大部分都是用!important来hack，对于ie6和firefox测试可以正常显示，&amp;nbsp;&lt;br /&gt;但是ie7对!important可以正确解释，会导致页面没按要求显示！找到一个针&amp;nbsp;&lt;br /&gt;对IE7不错的hack方式就是使用&amp;#8220;*+html&amp;#8221;，现在用IE7浏览一下，应该没有问题了。&amp;nbsp;&lt;br /&gt;现在写一个CSS可以这样：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;#1 { color: #333; } /* Moz */&amp;nbsp;&lt;br /&gt;* html #1 { color: #666; } /* IE6 */&amp;nbsp;&lt;br /&gt;*+html #1 { color: #999; } /* IE7 */&amp;nbsp;&lt;br /&gt;那么在firefox下字体颜色显示为#333，IE6下字体颜色显示为#666，IE7下字体颜色显示为#999。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;2 css布局中的居中问题&amp;nbsp;&lt;br /&gt;主要的样式定义如下：&amp;nbsp;&lt;br /&gt;&lt;br /&gt;body {TEXT-ALIGN: center;}&amp;nbsp;&lt;br /&gt;#center { MARGIN-RIGHT: auto; MARGIN-LEFT: auto; }&amp;nbsp;&lt;br /&gt;说明：&amp;nbsp;&lt;br /&gt;首先在父级元素定义TEXT-ALIGN: center;这个的意思就是在父级元素内的内容居中；对于IE这样设定就已经可以了。&amp;nbsp;&lt;br /&gt;但在mozilla中不能居中。解决办法就是在子元素定义时候设定时再加上&amp;#8220;MARGIN-RIGHT: auto;MARGIN-LEFT: auto; &amp;#8221;&amp;nbsp;&lt;br /&gt;需要说明的是，如果你想用这个方法使整个页面要居中，建议不要套在一个DIV里，你可以依次拆出多个div，&amp;nbsp;&lt;br /&gt;只要在每个拆出的div里定义MARGIN-RIGHT: auto;MARGIN-LEFT: auto; 就可以了。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;3 盒模型不同解释.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;#box{ width:600px; //for ie6.0- w\idth:500px; //for ff+ie6.0}&amp;nbsp;&lt;br /&gt;#box{ width:600px!important //for ff width:600px; //for ff+ie6.0 width /**/:500px; //for ie6.0-}&amp;nbsp;&lt;br /&gt;&lt;br /&gt;4 浮动ie产生的双倍距离&amp;nbsp;&lt;br /&gt;&lt;br /&gt;#box{ float:left; width:100px; margin:0 0 0 100px; //这种情况之下IE会产生200px的距离 display:inline; //使浮动忽略}&amp;nbsp;&lt;br /&gt;这里细说一下block,inline两个元素,Block元素的特点是:总是在新行上开始,高度,宽度,行高,边距都可以控制(块元素);Inline元素的特点是:和其他元素在同一行上,...不可控制(内嵌元素);&amp;nbsp;&lt;br /&gt;&lt;br /&gt;#box{ display:block; //可以为内嵌元素模拟为块元素 display:inline; //实现同一行排列的的效果 diplay:table;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;5 IE与宽度和高度的问题&amp;nbsp;&lt;br /&gt;&lt;br /&gt;IE不认得min-这个定义，但实际上它把正常的width和height当作有min的情况来使。这样问题就大了，如果只用宽度和高度，&amp;nbsp;&lt;br /&gt;正常的浏览器里这两个值就不会变，如果只用min-width和min-height的话，IE下面根本等于没有设置宽度和高度。&amp;nbsp;&lt;br /&gt;比如要设置背景图片，这个宽度是比较重要的。要解决这个问题，可以这样：&amp;nbsp;&lt;br /&gt;#box{ width: 80px; height: 35px;}html&amp;gt;body #box{ width: auto; height: auto; min-width: 80px; min-height: 35px;}&amp;nbsp;&lt;br /&gt;&lt;br /&gt;6 页面的最小宽度&amp;nbsp;&lt;br /&gt;&lt;br /&gt;min-width是个非常方便的CSS命令，它可以指定元素最小也不能小于某个宽度，这样就能保证排版一直正确。但IE不认得这个，&lt;br /&gt;而它实际上把width当做最小宽度来使。为了让这一命令在IE上也能用，可以把一个&amp;lt;div&amp;gt; 放到 &amp;lt;body&amp;gt; 标签下，然后为div指定一个类：&amp;nbsp;&lt;br /&gt;然后CSS这样设计：&amp;nbsp;&lt;br /&gt;#container{ min-width: 600px; width:expression(document.body.clientWidth &amp;lt; 600? "600px": "auto" );}&amp;nbsp;&lt;br /&gt;第一个min-width是正常的；但第2行的width使用了Javascript，这只有IE才认得，这也会让你的HTML文档不太正规。它实际上通过Javascript的判断来实现最小宽度。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;7 清除浮动&amp;nbsp;&lt;br /&gt;&lt;br /&gt;.hackbox{ display:table; //将对象作为块元素级的表格显示}或者.hackbox{ clear:both;}&amp;nbsp;&lt;br /&gt;或者加入:after（伪对象）,设置在对象后发生的内容，通常和content配合使用，IE不支持此伪对象，非Ie 浏览器支持，&amp;nbsp;&lt;br /&gt;所以并不影响到IE/WIN浏览器。这种的最麻烦的......#box:after{ content: "."; display: block; height: 0; clear: both; visibility: hidden;}&amp;nbsp;&lt;br /&gt;&lt;br /&gt;8 DIV浮动IE文本产生3象素的bug&amp;nbsp;&lt;br /&gt;&lt;br /&gt;左边对象浮动，右边采用外补丁的左边距来定位，右边对象内的文本会离左边有3px的间距.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;#box{ float:left; width:800px;}#left{ float:left; width:50%;}#right{ width:50%;}*html #left{ margin-right:-3px; //这句是关键}&amp;nbsp;&lt;br /&gt;HTML代码&amp;lt;div id="box"&amp;gt; &amp;lt;div id="left"&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;div id="right"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;9 属性选择器(这个不能算是兼容,是隐藏css的一个bug)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;p[id]{}div[id]{}&amp;nbsp;&lt;br /&gt;这个对于IE6.0和IE6.0以下的版本都隐藏,FF和OPera作用&amp;nbsp;&lt;br /&gt;属性选择器和子选择器还是有区别的,子选择器的范围从形式来说缩小了,属性选择器的范围比较大,如p[id]中,所有p标签中有id的都是同样式的.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;10 IE捉迷藏的问题&amp;nbsp;&lt;br /&gt;&lt;br /&gt;当div应用复杂的时候每个栏中又有一些链接，DIV等这个时候容易发生捉迷藏的问题。&amp;nbsp;&lt;br /&gt;有些内容显示不出来，当鼠标选择这个区域是发现内容确实在页面。&amp;nbsp;&lt;br /&gt;解决办法：对#layout使用line-height属性 或者给#layout使用固定高和宽。页面结构尽量简单。&amp;nbsp;&lt;br /&gt;&lt;br /&gt;11 高度不适应&amp;nbsp;&lt;br /&gt;&lt;br /&gt;高度不适应是当内层对象的高度发生变化时外层高度不能自动进行调节，特别是当内层对象使用&amp;nbsp;&lt;br /&gt;margin 或paddign 时。&amp;nbsp;&lt;br /&gt;例：&amp;nbsp;&lt;br /&gt;&amp;lt;div id="box"&amp;gt;&amp;nbsp;&lt;br /&gt;p对象中的内容&amp;nbsp;&lt;br /&gt;&amp;lt;/div&amp;gt;&amp;nbsp;&lt;br /&gt;CSS：#box {background-color:#eee; }&amp;nbsp;&lt;br /&gt;#box p {margin-top: 20px;margin-bottom: 20px; text-align:center; }&amp;nbsp;&lt;br /&gt;解决方法：在P对象上下各加2个空的div对象CSS代码：.1{height:0px;overflow:hidden;}或者为DIV加上border属性。&lt;/span&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2227275.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/28/2227275.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/20/2219007.html</id><title type="text">js arguments 用法</title><summary type="text">&amp;lt;script&amp;gt;function a(){alert(arguments[0]);}a(&amp;quot;bb&amp;quot;);&amp;lt;/script&amp;gt;</summary><published>2011-10-20T07:31:00Z</published><updated>2011-10-20T07:31:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2219007.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2219007.html"/><content type="html">&lt;div&gt;&lt;div&gt;&amp;lt;script&amp;gt;&lt;/div&gt;&lt;div&gt;function a()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;alert(arguments[0]);&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;a("bb");&lt;/div&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2219007.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2219007.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/20/2218988.html</id><title type="text">学习jQuery必须知道的几种常用方法  转</title><summary type="text">jQuery事件处理ready(fn)代码：$(document).ready(function(){ // Your code here...})；作用：它可以极大地提高web应用程序的响应速度。通过使用这个方法，可以在DOM载入就绪能够读取并操纵时立即调用你所绑定的函数，而99.99%的JavaScript函数都需要在那一刻执行。bind(type,[data],fn)代码：$(&amp;quot;p&amp;quot;).bind(&amp;quot;click&amp;quot;, function(){ alert( $(this).text() );}); 作用：为每一个匹配元素的特定事件（像click）绑定一个</summary><published>2011-10-20T07:11:00Z</published><updated>2011-10-20T07:11:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218988.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218988.html"/><content type="html">&lt;div&gt;&lt;span style="color: #333333; font-family: 宋体; line-height: 28px; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;jQuery事件处理&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;ready(fn)&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$(document).ready(function(){&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; // Your code here...&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;})；&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：它可以极大地提高web应用程序的响应速度。通过使用这个方法，可以在DOM载入就绪能够读取并操纵时立即调用你所绑定的函数，而99.99%的JavaScript函数都需要在那一刻执行。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;bind(type,[data],fn)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("p").bind("click", function(){&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; alert( $(this).text() );&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;}); &lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：为每一个匹配元素的特定事件（像click）绑定一个事件处理器函数。起到事件监听的作用。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;toggle(fn,fn)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("td").toggle(&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; function () {&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).addClass("selected");&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; },&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; function () {&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).removeClass("selected");&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; }&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;);&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：每次点击时切换要调用的函数。如果点击了一个匹配的元素，则触发指定的第一个函数，当再次点击同一元素时，则触发指定的第二个函数。挺有趣的一个函数，在动态实现某些功能的时候可能会用到。(像click(),focus(),keydown()这样的事件这里就不提了，那些都是开发中比较常用到的。)&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;jQuery外观效果&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;addClass(class)和removeClass(class)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 443px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$(".stripe tr").mouseover(function(){&amp;nbsp; &lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).addClass("over");}).mouseout(function(){ &lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).removeClass("over");})&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;});&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;也可以写成：&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 478px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$(".stripe tr").mouseover(function() { $(this).addClass("over") });&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;$(".stripe tr").mouseout(function() { $(this).removeClass("over") });&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：为指定的元素添加或移除样式，从而实现动态的样式效果，上面的实例中实现鼠标移动双色表格的代码&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;css(name,value)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("p").css("color","red");&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：很简单，就是在匹配的元素中，设置一个样式属性的值。这个个人感觉和上面的addClass(class)有点类似。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;slide(),hide(),fadeIn(), fadeout(), slideUp() ,slideDown()&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 464px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("#btnShow").bind("click",function(event){ $("#divMsg").show() });&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;$("#btnHide").bind("click",function(evnet){ $("#divMsg").hide() });&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：jQuery中提供的比较常用的几个动态效果的函数。还可以添加参数：show(speed,[callback])以优雅的动画显示所有匹配的元素，并在显示完成后可选地触发一个回调函数。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;animate(params[,duration[,easing[,callback]]])&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：制作动画效果用到的函数，功能非常的强大，可以连续使用此函数。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;查找筛选&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;map(callback)&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;HTML 代码:&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 575px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;strong&gt;Values:&amp;nbsp;&lt;/strong&gt; &lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&amp;lt; INPUT value=John name=name&amp;gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; &amp;lt; INPUT value=password name=password&amp;gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;lt; INPUT value="&amp;lt; A href=" name=url ? %22 ejohn.org http:&amp;gt;http://ejohn.org/%22/&amp;lt; /A&amp;gt; &amp;lt; FORM&amp;gt;&lt;/p&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery 代码:&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&amp;lt; /FORM&amp;gt; &lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("p").append( $("input").map(function(){&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; return $(this).val();&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;}).get().join(", ") ); &lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;结果:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 568px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;[ John, password, &amp;lt; A href="http://ejohn.org/%3C/p"&amp;gt;http://ejohn.org/%3C/p&amp;lt; /A&amp;gt;&amp;gt; ]&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：将一组元素转换成其他数组（不论是否是元素数组）你可以用这个函数来建立一个列表，不论是值、属性还是CSS样式，或者其他特别形式。这都可以用'$.map()'来方便的建立。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;find(expr)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;HTML 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&amp;lt; SPAN&amp;gt;Hello&amp;lt; /SPAN&amp;gt;, how are you?&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;jQuery 代码:  &lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;$("p").find("span") &lt;br style="clear: both; width: 0px; height: 0px; " /&gt;结果:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;[ &amp;lt; SPAN&amp;gt;Hello&amp;lt; /SPAN&amp;gt; ]&lt;/p&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;作用：搜索所有与指定表达式匹配的元素。这个函数是找出正在处理的元素的后代元素的好方法。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;文档处理&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;attr(key,value)&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;HTML 代码:&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&amp;lt; IMG&amp;gt;&amp;lt; IMG&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;jQuery 代码:&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("img").attr("src","test.jpg");&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;作用：取得或设置匹配元素的属性值。通过这个方法可以方便地从第一个匹配元素中获取一个属性的值。如果元素没有相应属性，则返回 undefined 。在控制HTML标记上是必备的工具。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;html()/html(val)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;HTML 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&amp;lt; DIV&amp;gt; &lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Hello&lt;/p&gt;&amp;lt; /DIV&amp;gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;$("div").html();&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;结果:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Hello&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：取得或设置匹配元素的html内容，同类型的方法还有text()和val()。前者是取得所有匹配元素的内容。，后者是获得匹配元素的当前值。三者有相似的地方常用在内容的操作上。&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;wrap(html)&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;HTML 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Test Paragraph.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;$("p").wrap("  &amp;lt; DIV class=wrap&amp;gt;&amp;lt; /DIV&amp;gt;");&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;结果: &amp;lt; DIV class=wrap&amp;gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Test Paragraph.&lt;/p&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：把所有匹配的元素用其他元素的结构化标记包裹起来。这种包装对于在文档中插入额外的结构化标记最有用，而且它不会破坏原始文档的语义品质。 可以灵活的修改我们的DOM。&lt;/p&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;empty()&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;HTML 代码:&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 686px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Hello, Person &amp;lt; A href="http://new.51cto.com/wuyou/news_edit.php?artID=127754#"&amp;gt;and person&amp;lt; /A&amp;gt;&lt;/p&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;$("p").empty();&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;结果:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：删除匹配的元素集合中所有的子节点。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Ajax处理&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;load(url,[data],[callback])&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;url (String) : 待装入 HTML 网页网址。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;data (Map) : (可选) 发送至服务器的 key/value 数据。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;callback (Callback) : (可选) 载入成功时回调函数。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 422px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("#feeds").load("feeds.aspx", {limit: 25}, function(){&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;&amp;nbsp; alert("The last 25 entries in the feed have been loaded");&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;});&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;作用：载入远程 HTML 文件代码并插入至 DOM 中。这也是Jquery操作Ajax最常用最有效的方法。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;serialize()&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;HTML 代码:&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Results:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 554px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&amp;lt; FORM&amp;gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; &amp;lt; SELECT name=single&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt; OPTION selected&amp;gt;Single&amp;lt; /OPTION&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 554px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&amp;lt; OPTION&amp;gt;Single2&amp;lt; /OPTION&amp;gt;&amp;nbsp;&amp;lt; /SELECT&amp;gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; &amp;lt; SELECT multiple name=multiple&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt; OPTION selected&amp;gt;Multiple&amp;lt; /OPTION&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 554px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&amp;lt; OPTION&amp;gt;Multiple2&amp;lt; /OPTION&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt; OPTION selected&amp;gt;Multiple3&amp;lt; /OPTION&amp;gt;&amp;nbsp;&amp;lt; /SELECT&amp;gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; &amp;lt; INPUT value=check1 type=checkbox name=check&amp;gt; check1&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; &amp;lt; INPUT value=check2 type=checkbox name=check &lt;br style="clear: both; width: 0px; height: 0px; " /&gt;checked="checked"/&amp;gt; check2&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; &amp;lt; INPUT value=radio1 type=radio name=radio &lt;br style="clear: both; width: 0px; height: 0px; " /&gt;checked="checked"/&amp;gt; radio1&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; &amp;lt; INPUT value=radio2 type=radio name=radio&amp;gt; radio2&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;lt; /FORM&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 471px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$("#results").append( "&amp;lt; TT&amp;gt;" + $("form").serialize() + "&amp;lt; /TT&amp;gt;" ); &lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：序列化表格内容为字符串。用于 Ajax 请求。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;工具&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;jQuery.each(obj,callback)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;代码：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;$.each( [0,1,2], function(i, n){&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; alert( "Item #" + i + ": " + n );&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;});//遍历数组&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;$.each( { name: "John", lang: "JS" }, function(i, n){&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;&amp;nbsp; alert( "Name: " + i + ", Value: " + n );//遍历对象&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;});&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：通用例遍方法，可用于例遍对象和数组。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;jQuery.makeArray(obj)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;HTML 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 392px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;First&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&amp;lt; DIV&amp;gt;Second&amp;lt; /DIV&amp;gt; &lt;div&gt;Third&amp;lt; /DIV&amp;gt; &amp;lt; DIV&amp;gt;Fourth&lt;/div&gt;&lt;div&gt;&amp;lt; /DIV&amp;gt;&lt;/div&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;br style="clear: both; width: 0px; height: 0px; " /&gt;jQuery 代码:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#ffffff" cellpadding="2" width="400" align="center"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td bgcolor="#e6e6e6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 450px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;var arr = jQuery.makeArray(document.getElementsByTagName("div"));&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;结果:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Fourth&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Third&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Second&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;First&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：将类数组对象转换为数组对象。使我们可以在数组和对象之间灵活的转换。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;jQuery.trim(str)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;作用：这个大家应该很熟悉，就是去掉字符串起始和结尾的空格。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;小结：在实际的开发中我们可能会用到其他的方法和属性，以上只是个人认为新手初学jQuery时，必须掌握的一些方法。仅供大家学习的参考。有什么不对的高手指教。&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2218988.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218988.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/20/2218981.html</id><title type="text">jQuery选择器</title><summary type="text">jQuery 选择器选择器实例选取*$(&amp;quot;*&amp;quot;)所有元素#id$(&amp;quot;#lastname&amp;quot;)id=&amp;quot;lastname&amp;quot; 的元素.class$(&amp;quot;.intro&amp;quot;)所有 class=&amp;quot;intro&amp;quot; 的元素element$(&amp;quot;p&amp;quot;)所有 &amp;lt;p&amp;gt; 元素.class.class$(&amp;quot;.intro.demo&amp;quot;)所有 class=&amp;quot;intro&amp;quot; 且 class=&amp;quot;demo&amp;quot; 的元素:first$(&amp;quot;p:firs</summary><published>2011-10-20T07:07:00Z</published><updated>2011-10-20T07:07:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218981.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218981.html"/><content type="html">&lt;div&gt;&lt;span style="color: #333333; font-family: 宋体; line-height: 28px; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div&gt;&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; line-height: normal; "&gt;&lt;p&gt;&lt;strong&gt;jQuery 选择器&lt;/strong&gt;&lt;/p&gt;&lt;table style="font-family: Arial, Helvetica, sans-serif; margin-top: 10px; border-collapse: collapse; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #888888; border-right-color: #888888; border-bottom-color: #888888; border-left-color: #888888; width: 606px; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th style="vertical-align: baseline; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #cccccc; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #888888; border-right-color: #888888; border-bottom-color: #888888; border-left-color: #888888; text-align: left; "&gt;选择器&lt;/th&gt;&lt;th style="vertical-align: baseline; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #cccccc; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #888888; border-right-color: #888888; border-bottom-color: #888888; border-left-color: #888888; text-align: left; "&gt;实例&lt;/th&gt;&lt;th style="vertical-align: baseline; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #cccccc; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #888888; border-right-color: #888888; border-bottom-color: #888888; border-left-color: #888888; text-align: left; "&gt;选取&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_all.asp" title="jQuery * 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;*&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("*")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_id.asp" title="jQuery # 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;#&lt;em&gt;id&lt;/em&gt;&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("#lastname")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;id="lastname" 的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_class.asp" title="jQuery . 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;.&lt;em&gt;class&lt;/em&gt;&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(".intro")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有  的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_element.asp" title="jQuery element 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;em&gt;element&lt;/em&gt;&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("p")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 &amp;lt;p&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;.&lt;em&gt;class&lt;/em&gt;.&lt;em&gt;class&lt;/em&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(".intro.demo")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有  且  的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_first.asp" title="jQuery :first 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:first&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("p:first")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;第一个 &amp;lt;p&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_last.asp" title="jQuery :last 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:last&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("p:last")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;最后一个 &amp;lt;p&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_even.asp" title="jQuery :even 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:even&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("tr:even")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有偶数 &amp;lt;tr&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_odd.asp" title="jQuery :odd 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:odd&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("tr:odd")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有奇数 &amp;lt;tr&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_eq.asp" title="jQuery :eq() 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:eq(&lt;em&gt;index&lt;/em&gt;)&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("ul li:eq(3)")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;列表中的第四个元素（index 从 0 开始）&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_gt.asp" title="jQuery :gt 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:gt(&lt;em&gt;no&lt;/em&gt;)&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("ul li:gt(3)")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;列出 index 大于 3 的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_lt.asp" title="jQuery :lt 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:lt(&lt;em&gt;no&lt;/em&gt;)&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("ul li:lt(3)")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;列出 index 小于 3 的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;:not(&lt;em&gt;selector&lt;/em&gt;)&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("input:not(:empty)")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有不为空的 input 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_header.asp" title="jQuery :header 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:header&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":header")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有标题元素 &amp;lt;h1&amp;gt; - &amp;lt;h6&amp;gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_animated.asp" title="jQuery :animated 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:animated&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有动画元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_contains.asp" title="jQuery :contains 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:contains(&lt;em&gt;text&lt;/em&gt;)&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":contains('W3School')")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;包含指定字符串的所有元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_empty.asp" title="jQuery :empty 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:empty&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":empty")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;无子（元素）节点的所有元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;:hidden&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("p:hidden")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有隐藏的 &amp;lt;p&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_visible.asp" title="jQuery :visible 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:visible&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("table:visible")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有可见的表格&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;s1,s2,s3&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("th,td,.intro")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有带有匹配选择的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_attribute.asp" title="jQuery [attribute] 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;[&lt;em&gt;attribute&lt;/em&gt;]&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("[href]")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有带有 href 属性的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_attribute_equal_value.asp" title="jQuery [attribute=value] 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;[&lt;em&gt;attribute&lt;/em&gt;=&lt;em&gt;value&lt;/em&gt;]&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("[href='#']")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 href 属性的值等于 "#" 的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_attribute_notequal_value.asp" title="jQuery [attribute!=value] 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;[&lt;em&gt;attribute&lt;/em&gt;!=&lt;em&gt;value&lt;/em&gt;]&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("[href!='#']")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 href 属性的值不等于 "#" 的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_attribute_end_value.asp" title="jQuery [attribute$=value] 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;[&lt;em&gt;attribute&lt;/em&gt;$=&lt;em&gt;value&lt;/em&gt;]&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$("[href$='.jpg']")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 href 属性的值包含以 ".jpg" 结尾的元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input.asp" title="jQuery :input 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:input&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":input")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_text.asp" title="jQuery :text 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:text&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":text")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="text" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_password.asp" title="jQuery :password 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:password&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":password")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="password" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_radio.asp" title="jQuery :radio 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:radio&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":radio")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="radio" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_checkbox.asp" title="jQuery :checkbox 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:checkbox&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":checkbox")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="checkbox" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_submit.asp" title="jQuery :submit 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:submit&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":submit")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="submit" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_reset.asp" title="jQuery :reset 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:reset&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":reset")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="reset" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_button.asp" title="jQuery :button 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:button&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":button")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="button" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_image.asp" title="jQuery :image 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:image&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":image")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="image" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_file.asp" title="jQuery :file 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:file&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":file")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有 type="file" 的 &amp;lt;input&amp;gt; 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #ffffff; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_enabled.asp" title="jQuery :enabled 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:enabled&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":enabled")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有激活的 input 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_disabled.asp" title="jQuery :disabled 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:disabled&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":disabled")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有禁用的 input 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_selected.asp" title="jQuery :selected 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:selected&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":selected")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有被选取的 input 元素&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;&lt;a href="http://www.w3school.com.cn/jquery/selector_input_checked.asp" title="jQuery :checked 选择器" style="text-decoration: underline; color: #900b09; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: initial initial; background-repeat: initial initial; "&gt;:checked&lt;/a&gt;&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;$(":checked")&lt;/td&gt;&lt;td style="vertical-align: text-top; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 5px; background-color: #efefef; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #aaaaaa; border-right-color: #aaaaaa; border-bottom-color: #aaaaaa; border-left-color: #aaaaaa; "&gt;所有被选中的 input 元素&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2218981.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218981.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/20/2218930.html</id><title type="text">浅析jQuery框架与构造对象  转</title><summary type="text">文章针对jQuery 1.3.2版本，面向的读者应具备以下要求：1.非常熟悉HTML2.非常熟悉javascript语法知识3.熟悉javascript面向对象方面的知识4.熟练使用jQuery框架jQuery对象的初始化是写在匿名函数里的，就像这样：(function(){alert(&amp;quot;jQuery框架分析&amp;quot;)})();第一个括号是声明了一个函数，第二个括号是执行这个函数。也就是说，jQuery框架在页面载入的时候已经做了一些事情（这个个匿名函数已经被执行了）。做的这些事情使我们可以通过$(&amp;quot;#yourId&amp;quot;)或$(&amp;quot;.yourClass&amp;q</summary><published>2011-10-20T06:24:00Z</published><updated>2011-10-20T06:24:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218930.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218930.html"/><content type="html">&lt;span style="color: #333333; font-family: 宋体; font-size: 14px; line-height: 28px; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;文章针对jQuery 1.3.2版本，面向的读者应具备以下要求：&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;1.非常熟悉HTML&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;2.非常熟悉javascript语法知识&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;3.熟悉javascript面向对象方面的知识&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;4.熟练使用jQuery框架&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery对象的初始化是写在匿名函数里的，就像这样：&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;(function(){alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"jQuery框架分析"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;)})();&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;第一个括号是声明了一个函数，第二个括号是执行这个函数。也就是说，jQuery框架在页面载入的时候已经做了一些事情（这个个匿名函数已经被执行了）。做的这些事情使我们可以通过$("#yourId")或$(".yourClass")等方式获取页面元素，并把获取到的元素包装成jQuery对象。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;匿名函数是怎么实现这些功能的呢？&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;首先框架定义了两个核心对象&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;jQuery&amp;nbsp;=&amp;nbsp;window.jQuery&amp;nbsp;=&amp;nbsp;window.$&amp;nbsp;=&amp;nbsp;function(&amp;nbsp;selector,&amp;nbsp;context&amp;nbsp;)&amp;nbsp;{}&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;一个是jQuery&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;一个是$&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;这两个对象都指向一个函数&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;这个函数是我们使用$()或jQuery()方法时的入口，这个方法返回一个jQuery.fn.init( selector, context );的实例，其实这个实例是一个jQuery对象。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery对象是一个什么样的对象呢？&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery对象其实是一个javascript的数组&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;这个数组对象包含125个方法和4个属性&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;4个属性分别是&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;jQuery&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 当前的jQuery框架版本号&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;length&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 指示该数组对象的元素个数&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;context&amp;nbsp;&amp;nbsp;&amp;nbsp; 一般情况下都是指向HtmlDocument对象&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;selector&amp;nbsp;&amp;nbsp; 传递进来的选择器内容&amp;nbsp; 如：#yourId或.yourClass等&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;如果你通过$("#yourId")方法获取jQuery对象，并且你的页面中只有一个id为yourId的元素那么$("#yourId")[0]就是HtmlElement元素与document.getElementById("yourId")获取的元素是一样的&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;jQuery对象是怎么构造出来的呢？&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;这个对象就是刚才我们提到的&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;jQuery&amp;nbsp;=&amp;nbsp;window.jQuery&amp;nbsp;=&amp;nbsp;window.$&amp;nbsp;=&amp;nbsp;function(&amp;nbsp;selector,&amp;nbsp;context&amp;nbsp;)&amp;nbsp;{}&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;框架不只为此对象定义了一个方法，还定义了它的原型(prototype)&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;jQuery&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: red; background-color: inherit; "&gt;jQuery.fn&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;=&amp;nbsp;jQuery&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: red; background-color: inherit; "&gt;.prototype&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;=&amp;nbsp;{//此处为json对象}&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;原型的定义是通过json对象定义的&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;如&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;init:&amp;nbsp;function(&amp;nbsp;selector,&amp;nbsp;context&amp;nbsp;)&amp;nbsp;{&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//方法体}, &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;jQuery:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"1.3.2"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;,&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//属性 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;size:&amp;nbsp;function()&amp;nbsp;{&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//方法体}, &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//...... &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;}&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;前面提到的125个方法4个属性有一部分在这个json对象中完成定义的 这个json对象中第一个方法就是init方法也就是入口方法中的jQuery.fn.init( selector, context );此方法与一个正则表达式对象配合来构造jQuery对象&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;这个正则表达式为：&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;quickExpr&amp;nbsp;=&amp;nbsp;/^[^&amp;lt;]*(&amp;lt;(.|\s)+&amp;gt;)[^&amp;gt;]*$|^#([\w-]+)$/&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;下面我们说一下init方法的实现逻辑&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;此方法有两个参数&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;一个是selector（选择器）&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;一个是context（上下文）&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;selector就是我们用$("#yourId")或jQuery(".yourClass")传递进来的变量&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;这个参数不一定是字符串，也可能是其他形式的变量&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;等会儿我们就会介绍到&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;context参数我们在使用jQuery的时候很少用到,暂且不表&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;注意这两个参数都在返回的jQuery对象中体现出来了（以两个同名的属性展示）&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;下面看一下这个方法体内部的实现逻辑&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//如果没有选择器或者选择器为空的话，就把document对象赋值给他 &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;selector&amp;nbsp;=&amp;nbsp;selector&amp;nbsp;||&amp;nbsp;document;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//如果selector参数是dom元素，直接返回jQuery对象 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//也就是说你可以$(document.getElementById("allen"))把你的元素封装成jQuery对象 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;(&amp;nbsp;selector.nodeType&amp;nbsp;)&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #c00000; background-color: inherit; "&gt;0&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;=&amp;nbsp;selector; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;.length&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #c00000; background-color: inherit; "&gt;1&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;.context&amp;nbsp;=&amp;nbsp;selector; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;return&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;}&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//typeof&amp;nbsp;取对象的类型，用三个等号效率较高，&amp;nbsp;不需要类型转换，两个等号默认有类型转换 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;(&amp;nbsp;typeof&amp;nbsp;selector&amp;nbsp;===&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"string"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//这里用到了我们前面提到的正则表达式quickExpr &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//match其实是一个数组 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//第0个元素是与正则表达式相匹配的文本 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//第1个元素是与正则表达式的第1个子表达式相匹配的文本（如果有的话） &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//第2个元素是第2个子表达式相匹配的文本（如果有的话） &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//第3个元素是第3个子表达式相匹配的文本（如果有的话）这里就是元素的ID，不包含# &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;var&amp;nbsp;match&amp;nbsp;=&amp;nbsp;quickExpr.exec(&amp;nbsp;selector&amp;nbsp;);&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//正则表达式匹配到了内容&amp;nbsp;&amp;nbsp;&amp;nbsp;并且&amp;nbsp;match[1]不为空&amp;nbsp;或者&amp;nbsp;context为空 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//match[1]不为空的时候selector是HTML字符串，也就是你可以用$("&amp;nbsp; &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;xland &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;")把对象包装成jQuery对象 &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//context为空的时候selector是页面元素ID&amp;nbsp; &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;(&amp;nbsp;match&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;(match[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #c00000; background-color: inherit; "&gt;1&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;||&amp;nbsp;!context)&amp;nbsp;)&amp;nbsp;{&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//选择器为html字符串&amp;nbsp;&amp;nbsp;此情况暂且不表 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;(&amp;nbsp;match[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #c00000; background-color: inherit; "&gt;1&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;){ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;selector&amp;nbsp;=&amp;nbsp;jQuery.clean(&amp;nbsp;[&amp;nbsp;match[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #c00000; background-color: inherit; "&gt;1&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;],&amp;nbsp;context&amp;nbsp;);}&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//选择器为ID &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;else&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//得到元素 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;var&amp;nbsp;elem&amp;nbsp;=&amp;nbsp;document.getElementById(&amp;nbsp;match[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #c00000; background-color: inherit; "&gt;3&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;);&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//如果得到了这个元素但是元素的ID属性不是match[3]，跳入分支。分支里面的东西做了什么工作，暂且不表 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;(&amp;nbsp;elem&amp;nbsp;&amp;amp;&amp;amp;&amp;nbsp;elem.id&amp;nbsp;!=&amp;nbsp;match[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #c00000; background-color: inherit; "&gt;3&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;){ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;return&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;jQuery().find(&amp;nbsp;selector&amp;nbsp;);}&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//把得到的页面元素封装成jQuery对象 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//如果elem为空，就传入一个空数组，框架怎么处理此空数组，暂且不表 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//如果不为空就跳入我们前面说的if&amp;nbsp;(&amp;nbsp;selector.nodeType&amp;nbsp;)分支，构造出jQuery对象来 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;var&amp;nbsp;ret&amp;nbsp;=&amp;nbsp;jQuery(&amp;nbsp;elem&amp;nbsp;||&amp;nbsp;[]&amp;nbsp;);&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//设置jQuery对象的context属性 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;ret.context&amp;nbsp;=&amp;nbsp;document;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//设置jQuery对象的selector属性 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;ret.selector&amp;nbsp;=&amp;nbsp;selector;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//返回这个对象给调用者 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;return&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;ret; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;至此&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;var&amp;nbsp;obj&amp;nbsp;=&amp;nbsp;$(&amp;#8220;#yourId&amp;#8221;);&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;构造jQuery对象的初步工作就做完了&lt;/p&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2218930.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218930.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/20/2218894.html</id><title type="text">jQuery获取页面元素</title><summary type="text">$(&amp;quot;#yourId&amp;quot;)或$(&amp;quot;.yourClass&amp;quot;)等方式获取页面元素，并把获取到的元素包装成jQuery对象。</summary><published>2011-10-20T06:02:00Z</published><updated>2011-10-20T06:02:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218894.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218894.html"/><content type="html">&lt;span style="color: #333333; font-family: 宋体; font-size: 14px; line-height: 28px; "&gt;$("#yourId")或$(".yourClass")等方式获取页面元素，并把获取到的元素包装成jQuery对象。&lt;/span&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2218894.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218894.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/20/2218639.html</id><title type="text">javascript 基础  转</title><summary type="text">最近面试过一些人, 发现即使经验丰富的开发人员, 对于一些基础的理论和细节也常常会模糊. 写本文是因为就我自己而言第一次学习下面的内容时发现自己确实有所收获和感悟. 其实我们容易忽视的javascript的细节还有更多, 本文仅是冰山一角. 希望大家都能通过本文有所斩获.一. Javascript面向对象Javascript是一门面向对象的语言, 虽然很多书上都有讲解,但还是有很多初级开发者不了解.创建对象ps: 以前写过一篇详细的创建对象的文章(原型方法, 工厂方法等)但是找不到了, 回头如果还能找到我再添加进来.下面仅仅简单介绍.在C#里我们使用new关键字创建对象, 在javascrip</summary><published>2011-10-20T02:44:00Z</published><updated>2011-10-20T02:44:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218639.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218639.html"/><content type="html">&lt;div&gt;&lt;span style="color: #333333; font-family: 宋体; line-height: 28px; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;最近面试过一些人, 发现即使经验丰富的开发人员, 对于一些基础的理论和细节也常常会模糊. 写本文是因为就我自己而言第一次学习下面的内容时发现自己确实有所收获和感悟. 其实我们容易忽视的javascript的细节还有更多, 本文仅是冰山一角. 希望大家都能通过本文有所斩获.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;一. Javascript面向对象&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;Javascript是一门面向对象的语言, 虽然很多书上都有讲解,但还是有很多初级开发者不了解.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;创建对象&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;ps: 以前写过一篇详细的创建对象的文章(原型方法, 工厂方法等)但是找不到了, 回头如果还能找到我再添加进来.下面仅仅简单介绍.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;在C#里我们使用new关键字创建对象, 在javascript中也可以使用new关键字:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;objectA&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;new&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;Object();&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;但是实际上"new"可以省略:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;objectA&amp;nbsp;=&amp;nbsp;Object();&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;但是我建议为了保持语法一直,&amp;nbsp;&lt;strong style="font-weight: bold; text-align: center; "&gt;总是带着new关键字声明一个对象.&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;创建属性并赋值&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;在javascript中属性不需要声明, 在赋值时即自动创建:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA.name&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"my&amp;nbsp;name"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;访问属性&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;一般我们使用"."来分层次的访问对象的属性:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(objectA.name);&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;嵌套属性&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;对象的属性同样可以是任何javascript对象:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;objectB&amp;nbsp;=&amp;nbsp;objectA; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectB.other&amp;nbsp;=&amp;nbsp;objectA; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//此时下面三个值相当,&amp;nbsp;并且改变其中任何一个值其余两个值都改变 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA.name; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectB.name; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectB.other.name;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;使用索引&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;如果objectA上有一个属性名称为"school.college", 那么我们没法通过"."访问,因为"objectA.school.college"语句是指寻找objectA的school属性对象的college属性.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;这种情况我们需要通过索引设置和访问属性:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"school.college"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"BITI"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(objectA[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"school.college"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]);&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;下面几个语句是等效的:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"school.college"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"BITI"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;key&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"school.college"&lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(objectA[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"school.college"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(objectA[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"school"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;+&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"."&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;+&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"college"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(objectA[key]);&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;JSON 格式语法&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;JSON是指Javascript Object Notation, 即Javascript对象表示法.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;我们可以用下面的语句声明一个对象,同时创建属性:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//JSON &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;objectA&amp;nbsp;=&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"myName"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;age:&amp;nbsp;19, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;school: &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;college:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"大学"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"high&amp;nbsp;school"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"高中"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;like:[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"睡觉"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;,&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"C#"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;,&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"还是睡觉"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;] &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;JSON的语法格式是使用"{"和"}"表示一个对象, 使用"属性名称:值"的格式来创建属性, 多个属性用","隔开.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;上例中school属性又是一个对象. like属性是一个数组. 使用JSON格式的字符串创建完对象后, 就可以用"."或者索引的形式访问属性:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA.school[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"high&amp;nbsp;school"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA.like[1];&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;静态方法与实例方法&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;静态方法是指不需要声明类的实例就可以使用的方法.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;实例方法是指必须要先使用"new"关键字声明一个类的实例, 然后才可以通过此实例访问的方法.&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;staticClass()&amp;nbsp;{&amp;nbsp;};&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//声明一个类 &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;staticClass.staticMethod&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;()&amp;nbsp;{&amp;nbsp;alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"static&amp;nbsp;method"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;)&amp;nbsp;};&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//创建一个静态方法 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;staticClass.prototype.instanceMethod&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;()&amp;nbsp;{&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"instance&amp;nbsp;method"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;};&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//创建一个实例方法&lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;上面首先声明了一个类staticClass, 接着为其添加了一个静态方法staticMethod 和一个动态方法instanceMethod. 区别就在于添加动态方法要使用prototype原型属性.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;对于静态方法可以直接调用:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;staticClass.staticMethod();&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;但是动态方法不能直接调用:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;staticClass.instanceMethod();&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//语句错误,&amp;nbsp;无法运行.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;需要首先实例化后才能调用:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;instance&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;new&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;staticClass();&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//首先实例化 &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;instance.instanceMethod();&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//在实例上可以调用实例方法 &lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;二. 全局对象是window属性&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;通常我们在&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;ol style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 55px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; list-style-type: none; list-style-position: outside; list-style-image: none; word-wrap: break-word; word-break: normal; "&gt;&lt;/ol&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;然而我们还应该知道, 实际上全局变量objectA是创建在window对象上, 可以通过window对象访问到:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;window.objectA&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;三. 函数究竟是什么&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;我们都知道如何创建一个全局函数以及如何调用:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;myMethod() &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"Hello!"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;} &amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;myMethod();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;其实同全局对象一样, 使用function关键字创建的方法(也可以创建类)的名称, 实际上是为window对象创建了myMethod属性, 并且值是一个匿名方法, 上面的语句等同于:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;window.myMethod&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;() &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"Hello!"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;}&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;无论使用哪种方式声明, 实际保存时都是使用函数名创建window对象的属性. 并且值只有函数体没有函数名称.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;所以,下面三种声明方式是等效的:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;myMethod() &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"Hello!"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;} &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;window.myMethod&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;() &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"Hello!"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;} &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;myMethod&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;() &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"Hello!"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;}&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;四. "this"究竟是什么&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;在C#中,this变量通常指类的当前实例. 在javascript则不同, javascript中的"this"是函数上下文,不是由声明决定,而是由如何调用决定.因为全局函数其实就是window的属性, 所以在顶层调用全局函数时的this是指window对象.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;下面的例子可以很好的说明这一切:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;o1&amp;nbsp;=&amp;nbsp;{&amp;nbsp;name:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"o1&amp;nbsp;name"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;}; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window.name&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"window&amp;nbsp;name"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;function&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;showName() &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;this&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;.name); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;o1.show&amp;nbsp;=&amp;nbsp;showName; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window.show&amp;nbsp;=&amp;nbsp;showName; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&amp;nbsp;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;showName(); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;o1.show(); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window.show();&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;结果&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span  style="white-space:pre"&gt;	&lt;/span&gt;window name&lt;/p&gt;&lt;p&gt;&lt;span  style="white-space:pre"&gt;	&lt;/span&gt;o1 name&lt;/p&gt;&lt;p&gt;&lt;span  style="white-space:pre"&gt;	&lt;/span&gt;window name&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span  style="white-space:pre"&gt;	&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;结果证明在顶层调用函数和使用window对象调用函数时, this都指向window对象. 而在对象中调用函数时this指向当前对象.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;五. javascript中的闭包&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;闭包的概念比较难以理解, 先看闭包的定义:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;闭包是一个拥有许多变量和绑定了这些变量的环境的表达式(通常是一个函数)，因而这些变量也是该表达式的一部分。&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;简单表达:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;闭包就是function实例以及执行function实例时来自环境的变量.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;先看下面的例子:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;lt;!DOCTYPE&amp;nbsp;html&amp;nbsp;PUBLIC&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"-//W3C//DTD&amp;nbsp;XHTML&amp;nbsp;1.0&amp;nbsp;Transitional//EN"&lt;/span&gt;&amp;nbsp;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;lt;html&amp;nbsp;xmlns=&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;lt;head&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;lt;/head&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;lt;body&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;div&amp;nbsp;id=&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"divResult"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;gt;&amp;lt;/div&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;script&amp;nbsp;type=&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"text/javascript"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;function&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;start() &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;var&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;count&amp;nbsp;=&amp;nbsp;0; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;window.setInterval(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;&lt;strong&gt;function&lt;/strong&gt;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;() &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;document.getElementById(&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"divResult"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;).innerHTML&amp;nbsp;+=&amp;nbsp;count&amp;nbsp;+&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"&amp;lt;br/&amp;gt;"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;count++; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;},&amp;nbsp;3000); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;start(); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/script&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;lt;/body&amp;gt; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;lt;/html&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;count是start函数体内的变量, 通常我们理解count的作用于是在start()函数内, 在调用start()函数结束后应该也会消失.但是此示例的结果是count变量会一直存在,并且每次被加1:&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; text-align: center; "&gt;&lt;a href="http://images.51cto.com/files/uploadimg/20110419/1426011.png" target="_blank" style="color: #004276; text-decoration: underline; "&gt;&lt;img border="0" alt="从零开始学习jQuery(剧场版) 你必须知道的javascript" src="http://images.51cto.com/files/uploadimg/20110419/1426011.png" width="88" height="91" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-color: initial; text-align: center; border-style: initial; border-color: initial; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;因为count变量是setInterval中创建的匿名函数(就是包含count++的函数)的闭包的一部分!&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;再通俗的讲, 闭包首先就是函数本身, 比如上面这个匿名函数本身, 同时加上在这个函数运行时需要用到的count变量.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;javascript中的闭包是隐式的创建的, 而不像其他支持闭包的语言那样需要显式创建. 我们在C#语言中很少碰到是因为C#中无法在方法中再次声明方法. 而在一个方法中调用另一个方法通常使用参数传递数据.&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2218639.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218639.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/kevinge/archive/2011/10/20/2218529.html</id><title type="text">JSON</title><summary type="text">JSON 格式语法JSON是指Javascript Object Notation, 即Javascript对象表示法.我们可以用下面的语句声明一个对象,同时创建属性://JSON varobjectA={ name:&amp;quot;myName&amp;quot;, age:19, school: { college:&amp;quot;大学&amp;quot;, &amp;quot;highschool&amp;quot;:&amp;quot;高中&amp;quot; }, like:[&amp;quot;睡觉&amp;quot;,&amp;quot;C#&amp;quot;,&amp;quot;还是睡觉&amp;quot;] }JSON的语法格式是使用&amp;quot;{&amp;quot;和&amp;quot;}</summary><published>2011-10-20T01:38:00Z</published><updated>2011-10-20T01:38:00Z</updated><author><name>白开水皮皮</name><uri>http://www.cnblogs.com/kevinge/</uri></author><link rel="alternate" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218529.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218529.html"/><content type="html">&lt;span style="color: #333333; font-family: 宋体; font-size: 14px; line-height: 28px; "&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; text-indent: 28px; background-color: transparent; "&gt;&lt;strong style="font-weight: bold; text-align: center; "&gt;JSON 格式语法&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;JSON是指Javascript Object Notation, 即Javascript对象表示法.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;我们可以用下面的语句声明一个对象,同时创建属性:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #008200; background-color: inherit; "&gt;//JSON &lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; "&gt;var&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;objectA&amp;nbsp;=&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;name:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"myName"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;age:&amp;nbsp;19, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;school: &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;college:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"大学"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"high&amp;nbsp;school"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;:&amp;nbsp;&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"高中"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}, &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;like:[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"睡觉"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;,&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"C#"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;,&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"还是睡觉"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;] &amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;JSON的语法格式是使用"{"和"}"表示一个对象, 使用"属性名称:值"的格式来创建属性, 多个属性用","隔开.&lt;/p&gt;&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "&gt;上例中school属性又是一个对象. like属性是一个数组. 使用JSON格式的字符串创建完对象后, 就可以用"."或者索引的形式访问属性:&lt;/p&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;ol style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: inherit; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA.school[&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; "&gt;"high&amp;nbsp;school"&lt;/span&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;]; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; color: #5c5c5c; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "&gt;objectA.like[1];&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/span&gt;&lt;img src="http://www.cnblogs.com/kevinge/aggbug/2218529.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/kevinge/archive/2011/10/20/2218529.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
