<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/feedsky2.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/shawphy" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/shawphy" type="application/rss+xml"></fs:self_link><lastBuildDate>Fri, 02 Jan 2009 16:48:41 GMT</lastBuildDate><title>走走停停看看</title><description>介绍一些jQuery,CSS的内容</description><link>http://shawphy.com</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Fri, 02 Jan 2009 16:48:41 GMT</pubDate><item><title>08的小结</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678168/5006247/1/item.html</link><content:encoded>&lt;p&gt;08过去了，09来了，本来这个小结应该前几天写的，但总因为种种事情而耽搁了，现在补回来。&lt;br /&gt;
细数这个博客开张马上就满一年了。最开始用了pjblog现在换成了wordpress&lt;br /&gt;
中间又断了将近半年事件。&lt;br /&gt;
说是以前端为主，但其实发现关于HTML和CSS内容很少，基本上都是jQuery为主。&lt;br /&gt;
即将到来的2009年里，这里可能会有新的内容，涉及正则表达式，Flex，Python，PHP也可能有EditPlus和VIM。而HTML和CSS以及JS、jQuery内容依然会跟进。服务器我也打算搬到国内来。Godaddy的实在太慢，我用不下去了……&lt;br /&gt;
一不小心小结变成了展望，罪过罪过。总之，过去一年多谢各位的支持，将来一年请继续支持！&lt;/p&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/bb8573227f88e670659da59ce4ca3276&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/bb8573227f88e670659da59ce4ca3276/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=47c2c053cab6541663ef3c6658315a8c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=47c2c053cab6541663ef3c6658315a8c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=feeb363b577c905a6570005251fa27d2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=feeb363b577c905a6570005251fa27d2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2009/01/something-of-2008.html/feed</wfw:commentRss><description>08过去了，09来了，本来这个小结应该前几天写的，但总因为种种事情而耽搁了，现在补回来。
细数这个博客开张马上就满一年了。最开始用了pjblog现在换成了wordpress
中间又断了将近半年事件。
说是以前端为主，但其实发现关于HTML和CSS内容很少，基本上都是jQuery为主。
即将到来的2009年里，这里可能会有新的内容，涉及正则表达式，Flex，Python，PHP也可能有EditPlus和VIM。而HTML和CSS以及JS、jQuery内容依然会跟进。服务器我也打算搬到国内来。Godaddy的实在太慢，我用不下去了……
一不小心小结变成了展望，罪过罪过。总之，过去一年多谢各位的支持，将来一年请继续支持！&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/bb8573227f88e670659da59ce4ca3276&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/bb8573227f88e670659da59ce4ca3276/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=47c2c053cab6541663ef3c6658315a8c&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=47c2c053cab6541663ef3c6658315a8c&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=feeb363b577c905a6570005251fa27d2&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=feeb363b577c905a6570005251fa27d2&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><pubDate>Sat, 03 Jan 2009 00:48:41 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2009/01/something-of-2008.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=137</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2009/01/something-of-2008.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678168/5006247</fs:itemid></item><item><title>我的卓越亚马逊和当当购书经历</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678169/5006247/1/item.html</link><content:encoded>&lt;p&gt;&lt;strong&gt;Story&lt;/strong&gt;&lt;br /&gt;
这两家在国内可以说是走在风口浪尖上的两家B2C公司，也都逐步从之卖书到了什么都卖的大百货转型。&lt;br /&gt;
这回我从我前几天想买的一本&lt;a href=&quot;http://www.douban.com/subject/2154713/&quot;&gt;《精通正则表达式：第3版》&lt;/a&gt;。不要问我为什么不从china-pub买，只因为我对价格比较敏感。而不在乎书谁先出来。&lt;br /&gt;
各位也都可以从上面豆瓣链结里看到两个店的价格是一样的，都是55.9，蔚蓝在豆瓣页面里写是55.5，实际点进去是37.5 见：&lt;a href=&quot;http://www.wl.cn/2763130 &quot;&gt;这里 &lt;/a&gt;。（我才发现……书已经到手……不退了……其他同学有兴趣的赶紧下手……机会难得……不过最好先问清版本。）&lt;br /&gt;
事情是这样的，很早就眼馋这本超越语言界限的圣经级别的《精通正则表达式》了，年初的时候想买，但看到了&lt;a href=&quot;http://www.luanxiang.org/blog/archives/202.html&quot;&gt;勘误表&lt;/a&gt;之后慌了，这么多错误，我买回来自己一个一个对着勘误表现改一通可就累了，而且我也没有在书上写字习惯。所以就忍了。这几天看到了说&lt;a href=&quot;http://www.luanxiang.org/blog/archives/559.html&quot;&gt;第三版已经在卖了&lt;/a&gt;，就盘算着买了。&lt;br /&gt;
好了，罗嗦了这么久，正式开场&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Act 1&lt;/strong&gt;&lt;br /&gt;
跑到卓越当当上，都没有看到关于印次。而底下评论问第几次印刷的版本的，也不见有客服来回答。所以打算直接问客服了。&lt;br /&gt;
这局打平，两家都做的不好，当当上有“印次”和“印刷时间”的栏目，但没写，卓越压根就没有，只有“版本”这个栏目。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Act 2&lt;/strong&gt;&lt;br /&gt;
先说卓越，在页面最下面“如您需要帮助或对我们的客服有疑问，请联系我们。”。OK，点进去后就有了一个界面，填写信息后，等回音了。&lt;br /&gt;
接着是当当，在页面里死活找不到售前服务的地方（除了那个没用的提问部分），只在页面最底下找到了&amp;#8221;常见热点问题/找回密码/顾客建议/顾客投诉&amp;#8221;&lt;/p&gt;
&lt;p&gt;点哪个呢？肯定不是找回密码（这东西怎么放这里？放登录窗边上不就够了？），我也不想投诉也没有建议阿，想了半天，还是“常见热点问题”吧。进去，找了半天，什么新手指南，什么退款换货保修一应俱全，就是没有售前服务，只有一个“联系客服”，得这算是我要的了吧。进去一看，邮箱和400电话。OK，打开GMAIL，寄了邮件过去。&lt;/p&gt;
&lt;p&gt;给卓越的客服留言：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;这本《精通正则表达式（第三版）》&lt;br /&gt;
http://www.amazon.cn/dp/bkbk728354&lt;br /&gt;
我想确认一下是第几次印刷的版本。并且如果可以的话，请客服能顺便修改一下页面上的资料以方便其他读者。&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;给当当的邮件：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;当当网的客服：&lt;br /&gt;
你好&lt;br /&gt;
我想买《精通正则表达式（第三版）》&lt;br /&gt;
http://product.dangdang.com/product.aspx?product_id=20028613&lt;br /&gt;
但我不能确定这是第几次印刷的（以及印刷时间）。所以发信来询问一下。并希望能够顺便更新一下页面资料，以方便其他读者。&lt;br /&gt;
谢谢&lt;/p&gt;
&lt;p&gt;by Shawphy&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;这局，当当大败，浪费了我很多时间。到最后都要我用自己的邮箱给他们写信。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Act 3&lt;/strong&gt;&lt;br /&gt;
2008年12月19号当天（周五），在我发邮件一两个小时后，卓越的客服先给我的邮件。下午两点就给我回信了。&lt;br /&gt;
而当当我晚上8点发的邮件，第二天凌晨2点给我邮件……&lt;br /&gt;
卓越我是白天发的邮件，当当我是半夜2点发的邮件。卓越我看不出来邮件服务是不是24小时的，至少当当是24小时的。&lt;br /&gt;
当当小胜，当然也因为我的实验产生了一定的误差，所以本次实验信度不是很高，各位看官酌情取舍。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Act 4&lt;/strong&gt;&lt;br /&gt;
以下给出邮件主要部分（客套话就省了，虽然我不看，但他们得写）。&lt;br /&gt;
卓越给我的邮件：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;亲爱的朋友：&lt;/p&gt;
&lt;p&gt;您好！感谢您的email。&lt;/p&gt;
&lt;p&gt;很抱歉，您询问的商品：《精通正则表达式（第三版）》，问题我们暂时不能确认，我们和相关部门确认后会尽快回复您，&lt;/p&gt;
&lt;p&gt;并且会通知编辑人员更新页面信息。请您放心。
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;当当给我的邮件：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
亲爱的顾客：&lt;/p&gt;
&lt;p&gt;您好！非常感谢您对当当网的支持！非常抱歉，对于商品信息我们和您浏览的是同一个网页，我们看不到商品实物，如果您想了解商品更多的信息，您可以到商品单品页面提交评论，我们网站的编辑看到后会第一时间回复您。
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;我第二天周六10点半发现了这份回信，很日……回信曰：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
当当的客服：&lt;br /&gt;
你好&lt;br /&gt;
非常感谢你能及时反馈&lt;br /&gt;
但遗憾的是问题并没有能解决。&lt;br /&gt;
实际上如果可以仔细看一下的话，我早在今年6月19日就在此商品单页中提出关于印刷版次的问题，但半年过去了，至今没有任何答复。&lt;br /&gt;
现如今我直接发邮件给客服，也没能得到满意的答复。&lt;br /&gt;
希望当当各部门间能够更协调办事，能尽早给我们顾客一个满意的答复，谢谢。&lt;/p&gt;
&lt;p&gt;by Shawphy&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;50分钟后，回信曰：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;亲爱的顾客：&lt;/p&gt;
&lt;p&gt;您好！非常感谢您对当当网的支持！&lt;/p&gt;
&lt;p&gt;经查询，此商品为第3次印刷，印刷时间为2007/07/01，详细信息建议您察看商品的单品页面。同时此商品的内容如与网页介绍不符，建议您将其不符之处告知，以便处理。&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;我再日，曰：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;当当的客服：&lt;br /&gt;
你好&lt;br /&gt;
非常感谢及时能够回复邮件。&lt;br /&gt;
但遗憾的是依然没有能解答我的问题。&lt;br /&gt;
此书《精通正则表达式》&amp;#8221;第3版&amp;#8221;指的是 原书 第3版。&lt;br /&gt;
与第3次印刷不是一个概念。07年7月1日应该是第1次印刷。&lt;br /&gt;
此书据译者的博客上说，今年08年又有过两次印刷。并且修正了第一次印刷中的大部分错误。&lt;br /&gt;
所以我比较关心此书到底是第几次印刷版的。&lt;br /&gt;
也就是我比较关心当当页面上的&amp;#8221;印次&amp;#8221;和&amp;#8221;印刷时间&amp;#8221;这两项，而不是&amp;#8221;版次&amp;#8221;这一项。&lt;br /&gt;
希望能够进一步核实。&lt;br /&gt;
再次感谢辛勤的工作。&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;此后截止至本博文发表时，尚未有进一步回音(我保证我垃圾箱里也看过了，确实没有回信了)。事实面前，各位看官心知肚明，不用我作过多评论了。&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
Act 5&lt;/strong&gt;&lt;br /&gt;
23号星期二下午1点48分，受到了卓越的邮件：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;亲爱的朋友：&lt;/p&gt;
&lt;p&gt;您好！感谢您的email.&lt;/p&gt;
&lt;p&gt;非常抱歉耽误您的时间了，关于您询问的精通正则表达式（第3版）问题，经与相关部门工作人员确认，此图书是第3次印刷的版本。
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;OK，看到邮件后，马上下单，此时是四点半左右。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Act 6&lt;/strong&gt;&lt;br /&gt;
昨天收到邮件说出库了，今天中午收到书，确认是第三次印刷的版本。&lt;/p&gt;
&lt;p&gt;＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝&lt;br /&gt;
历时6天，卓越最终打出一个Good Ending，当当打出一个Bad Ending。&lt;br /&gt;
最后指出一个卓越的小瑕疵，我在邮件的反馈里提到，说希望尽快完成页面上的信息。但我书已经到了，页面上还没改。&lt;/p&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/fd0a79fd40df615bda262b400bc2ff0d&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/fd0a79fd40df615bda262b400bc2ff0d/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=f3d4837c4f34e88c0d03e26e753179ba&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=f3d4837c4f34e88c0d03e26e753179ba&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=44855dab65c295e996c3980c89a9e59d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=44855dab65c295e996c3980c89a9e59d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/amazon-vs-dangdang.html/feed</wfw:commentRss><description>Story
这两家在国内可以说是走在风口浪尖上的两家B2C公司，也都逐步从之卖书到了什么都卖的大百货转型。
这回我从我前几天想买的一本《精通正则表达式：第3版》。不要问我为什么不从china-pub买，只因为我对价格比较敏感。而不在乎书谁先出来。
各位也都可以从上面豆瓣链结里看到两个店的价格是一样的，都是55.9，蔚蓝在豆瓣页面里写是55.5，实际点进去是37.5 见：这里 。（我才发现……书已经到手……不退了……其他同学有兴趣的赶紧下手……机会难得……不过最好先问清版本。）
事情是这样的，很早就眼馋这本超越语言界限的圣经级别的《精通正则表达式》了，年初的时候想买，但看到了勘误表之后慌了，这么多错误，我买回来自己一个一个对着勘误表现改一通可就累了，而且我也没有在书上写字习惯。所以就忍了。这几天看到了说第三版已经在卖了，就盘算着买了。
好了，罗嗦了这么久，正式开场
Act 1
跑到卓越当当上，都没有看到关于印次。而底下评论问第几次印刷的版本的，也不见有客服来回答。所以打算直接问客服了。
这局打平，两家都做的不好，当当上有“印次”和“印刷时间”的栏目，但没写，卓越压根就没有，只有“版本”这个栏目。
Act 2
先说卓越，在页面最下面“如您需要帮助或对我们的客服有疑问，请联系我们。”。OK，点进去后就有了一个界面，填写信息后，等回音了。
接着是当当，在页面里死活找不到售前服务的地方（除了那个没用的提问部分），只在页面最底下找到了&amp;#8221;常见热点问题/找回密码/顾客建议/顾客投诉&amp;#8221;
点哪个呢？肯定不是找回密码（这东西怎么放这里？放登录窗边上不就够了？），我也不想投诉也没有建议阿，想了半天，还是“常见热点问题”吧。进去，找了半天，什么新手指南，什么退款换货保修一应俱全，就是没有售前服务，只有一个“联系客服”，得这算是我要的了吧。进去一看，邮箱和400电话。OK，打开GMAIL，寄了邮件过去。
给卓越的客服留言：
这本《精通正则表达式（第三版）》
http://www.amazon.cn/dp/bkbk728354
我想确认一下是第几次印刷的版本。并且如果可以的话，请客服能顺便修改一下页面上的资料以方便其他读者。
给当当的邮件：
当当网的客服：
你好
我想买《精通正则表达式（第三版）》
http://product.dangdang.com/product.aspx?product_id=20028613
但我不能确定这是第几次印刷的（以及印刷时间）。所以发信来询问一下。并希望能够顺便更新一下页面资料，以方便其他读者。
谢谢
by Shawphy
这局，当当大败，浪费了我很多时间。到最后都要我用自己的邮箱给他们写信。
Act 3
2008年12月19号当天（周五），在我发邮件一两个小时后，卓越的客服先给我的邮件。下午两点就给我回信了。
而当当我晚上8点发的邮件，第二天凌晨2点给我邮件……
卓越我是白天发的邮件，当当我是半夜2点发的邮件。卓越我看不出来邮件服务是不是24小时的，至少当当是24小时的。
当当小胜，当然也因为我的实验产生了一定的误差，所以本次实验信度不是很高，各位看官酌情取舍。
Act 4
以下给出邮件主要部分（客套话就省了，虽然我不看，但他们得写）。
卓越给我的邮件：
亲爱的朋友：
您好！感谢您的email。
很抱歉，您询问的商品：《精通正则表达式（第三版）》，问题我们暂时不能确认，我们和相关部门确认后会尽快回复您，
并且会通知编辑人员更新页面信息。请您放心。

当当给我的邮件：

亲爱的顾客：
您好！非常感谢您对当当网的支持！非常抱歉，对于商品信息我们和您浏览的是同一个网页，我们看不到商品实物，如果您想了解商品更多的信息，您可以到商品单品页面提交评论，我们网站的编辑看到后会第一时间回复您。

我第二天周六10点半发现了这份回信，很日……回信曰：

当当的客服：
你好
非常感谢你能及时反馈
但遗憾的是问题并没有能解决。
实际上如果可以仔细看一下的话，我早在今年6月19日就在此商品单页中提出关于印刷版次的问题，但半年过去了，至今没有任何答复。
现如今我直接发邮件给客服，也没能得到满意的答复。
希望当当各部门间能够更协调办事，能尽早给我们顾客一个满意的答复，谢谢。
by Shawphy
50分钟后，回信曰：
亲爱的顾客：
您好！非常感谢您对当当网的支持！
经查询，此商品为第3次印刷，印刷时间为2007/07/01，详细信息建议您察看商品的单品页面。同时此商品的内容如与网页介绍不符，建议您将其不符之处告知，以便处理。
我再日，曰：
当当的客服：
你好
非常感谢及时能够回复邮件。
但遗憾的是依然没有能解答我的问题。
此书《精通正则表达式》&amp;#8221;第3版&amp;#8221;指的是 原书 第3版。
与第3次印刷不是一个概念。07年7月1日应该是第1次印刷。
此书据译者的博客上说，今年08年又有过两次印刷。并且修正了第一次印刷中的大部分错误。
所以我比较关心此书到底是第几次印刷版的。
也就是我比较关心当当页面上的&amp;#8221;印次&amp;#8221;和&amp;#8221;印刷时间&amp;#8221;这两项，而不是&amp;#8221;版次&amp;#8221;这一项。
希望能够进一步核实。
再次感谢辛勤的工作。
此后截止至本博文发表时，尚未有进一步回音(我保证我垃圾箱里也看过了，确实没有回信了)。事实面前，各位看官心知肚明，不用我作过多评论了。

Act 5
23号星期二下午1点48分，受到了卓越的邮件：
亲爱的朋友：
您好！感谢您的email.
非常抱歉耽误您的时间了，关于您询问的精通正则表达式（第3版）问题，经与相关部门工作人员确认，此图书是第3次印刷的版本。

OK，看到邮件后，马上下单，此时是四点半左右。
Act 6
昨天收到邮件说出库了，今天中午收到书，确认是第三次印刷的版本。
＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝＝
历时6天，卓越最终打出一个Good Ending，当当打出一个Bad Ending。
最后指出一个卓越的小瑕疵，我在邮件的反馈里提到，说希望尽快完成页面上的信息。但我书已经到了，页面上还没改。&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/fd0a79fd40df615bda262b400bc2ff0d&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/fd0a79fd40df615bda262b400bc2ff0d/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=f3d4837c4f34e88c0d03e26e753179ba&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=f3d4837c4f34e88c0d03e26e753179ba&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=44855dab65c295e996c3980c89a9e59d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=44855dab65c295e996c3980c89a9e59d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><category>CSS</category><pubDate>Thu, 25 Dec 2008 17:28:55 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/amazon-vs-dangdang.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=136</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/amazon-vs-dangdang.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678169/5006247</fs:itemid></item><item><title>jQuery 1.3更新的内容</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678170/5006247/1/item.html</link><content:encoded>&lt;p&gt;前两天jQuery更新出了jQuery 1.3的beta版，今天有空看了看到底更新了点什么&lt;br /&gt;
看了下代码，选择器用上了新的引擎&lt;a href=&quot;http://github.com/jeresig/sizzle/tree/master&quot;&gt;Sizzle&lt;/a&gt;咯。（Sizzle为何？见下面简介）&lt;br /&gt;
得益于新的引擎，选择器支持:not(div,p)这种了多重的not了&lt;br /&gt;
增加了一个closest方法，用来找最近的一个匹配选择器的父元素。&lt;br /&gt;
LiveQuery似乎也集成了，用$(elem).live(type,fn)就能注册事件了，新添加的元素也同样享受这个服务～无须&lt;a href=&quot;http://shawphy.com/2008/07/bind-handle-on-the-new-added-elements-part-a.html&quot;&gt;重新帮定&lt;/a&gt;了。不想要的时候让他die()就行了。&lt;br /&gt;
更多的还没来得及看，不过看到了JavaEye上的&lt;a href=&quot;http://www.javaeye.com/news/4610-jquery-1-3-beta-release-integrated-sizzle&quot;&gt;文章&lt;/a&gt;，把这次的更新都说全了。可以移步去看看。&lt;a href=&quot;http://www.5iya.com/blog/post/jquery-1-3-jquery-ui.asp&quot;&gt;Cloudream&lt;/a&gt;在两个月前就对jQuery 1.3的alpha有所阐述了，建议也可以看看。&lt;br /&gt;
这次刚刚升级的大版本Bug一般都会很多，所以请不要急着用于产品中，建议等到明年3、4月份的时候有没有新的修正版出来的时候再升级到1.3版。&lt;/p&gt;
&lt;p&gt;补充内容：&lt;br /&gt;
Sizzle是jQuery作者John Resig新写的DOM选择器引擎。其速度号称业界第一……&lt;br /&gt;
不过简单看了一下，对于支持document.querySelectorAll的浏览器就主要用这个了（比如IE8），支持getElementsByClassName的也会优先用这个(Firefox等)。&lt;br /&gt;
也还有一些其他优化。&lt;br /&gt;
如果只想要用一个出色的选择器工具而不想要引入jQuery，可以考虑直接用Sizzle，超好用。压缩后才3、4K。完全可以基于此开发一套自己的脚本库。&lt;/p&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/5692345e1ea539b796192b033a5c445d&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/5692345e1ea539b796192b033a5c445d/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=9af3232918bdd3fbb842933abfa91549&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=9af3232918bdd3fbb842933abfa91549&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=49b1c5798147c285f6d8d6dabcdc0224&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=49b1c5798147c285f6d8d6dabcdc0224&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/whats-new-in-jquery-1-3.html/feed</wfw:commentRss><description>前两天jQuery更新出了jQuery 1.3的beta版，今天有空看了看到底更新了点什么
看了下代码，选择器用上了新的引擎Sizzle咯。（Sizzle为何？见下面简介）
得益于新的引擎，选择器支持:not(div,p)这种了多重的not了
增加了一个closest方法，用来找最近的一个匹配选择器的父元素。
LiveQuery似乎也集成了，用$(elem).live(type,fn)就能注册事件了，新添加的元素也同样享受这个服务～无须重新帮定了。不想要的时候让他die()就行了。
更多的还没来得及看，不过看到了JavaEye上的文章，把这次的更新都说全了。可以移步去看看。Cloudream在两个月前就对jQuery 1.3的alpha有所阐述了，建议也可以看看。
这次刚刚升级的大版本Bug一般都会很多，所以请不要急着用于产品中，建议等到明年3、4月份的时候有没有新的修正版出来的时候再升级到1.3版。
补充内容：
Sizzle是jQuery作者John Resig新写的DOM选择器引擎。其速度号称业界第一……
不过简单看了一下，对于支持document.querySelectorAll的浏览器就主要用这个了（比如IE8），支持getElementsByClassName的也会优先用这个(Firefox等)。
也还有一些其他优化。
如果只想要用一个出色的选择器工具而不想要引入jQuery，可以考虑直接用Sizzle，超好用。压缩后才3、4K。完全可以基于此开发一套自己的脚本库。&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/5692345e1ea539b796192b033a5c445d&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/5692345e1ea539b796192b033a5c445d/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=9af3232918bdd3fbb842933abfa91549&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=9af3232918bdd3fbb842933abfa91549&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=49b1c5798147c285f6d8d6dabcdc0224&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=49b1c5798147c285f6d8d6dabcdc0224&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><pubDate>Thu, 25 Dec 2008 01:59:28 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/whats-new-in-jquery-1-3.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=135</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/whats-new-in-jquery-1-3.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678170/5006247</fs:itemid></item><item><title>Help Test jQuery 1.3 Beta 1</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678171/5006247/1/item.html</link><content:encoded>&lt;p&gt;&lt;a href=&quot;http://blog.jquery.com/2008/12/22/help-test-jquery-13-beta-1/&quot;&gt;jQuery:  » Help Test jQuery 1.3 Beta 1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;没啥说的，jQuery 1.3的beta 1发布了，&lt;/p&gt;
&lt;p&gt;有能力的各位都测试一下，有问题的汇报一下&lt;/p&gt;
&lt;p&gt;把引用脚本的地址改成&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://code.jquery.com/jquery-1.3b1.js&quot;&gt;http://code.jquery.com/jquery-1.3b1.js&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;就行。不要用min或者pack版，不好定位问题&lt;/p&gt;
&lt;p&gt;主要改了选择器引擎，DOM操作，offset()方法，事件命名空间和事件触发等部分的逻辑。尤其是事件触发的部分，现在会冒泡了，可能导致问题。&lt;/p&gt;
&lt;p&gt;具体jQuery 1.3会预计在1月14日发布。&lt;/p&gt;
&lt;p&gt;发现问题可以去&lt;a href=&quot;http://dev.jquery.com/&quot;&gt;jQuery bug tracker&lt;/a&gt; 提交问题。别忘了附上精简过的测试代码就行。&lt;/p&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/3ee4dd0557e47b016b7639d4404d73bc&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/3ee4dd0557e47b016b7639d4404d73bc/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=ebe6a7a5ce4376b1912cb8f8eebc04e5&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=ebe6a7a5ce4376b1912cb8f8eebc04e5&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=4ec6fccedf557a935f956b017a6946d7&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=4ec6fccedf557a935f956b017a6946d7&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/help-test-jquery-13-beta-1.html/feed</wfw:commentRss><description>jQuery:  » Help Test jQuery 1.3 Beta 1.
没啥说的，jQuery 1.3的beta 1发布了，
有能力的各位都测试一下，有问题的汇报一下
把引用脚本的地址改成
http://code.jquery.com/jquery-1.3b1.js
就行。不要用min或者pack版，不好定位问题
主要改了选择器引擎，DOM操作，offset()方法，事件命名空间和事件触发等部分的逻辑。尤其是事件触发的部分，现在会冒泡了，可能导致问题。
具体jQuery 1.3会预计在1月14日发布。
发现问题可以去jQuery bug tracker 提交问题。别忘了附上精简过的测试代码就行。&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/3ee4dd0557e47b016b7639d4404d73bc&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/3ee4dd0557e47b016b7639d4404d73bc/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=ebe6a7a5ce4376b1912cb8f8eebc04e5&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=ebe6a7a5ce4376b1912cb8f8eebc04e5&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=4ec6fccedf557a935f956b017a6946d7&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=4ec6fccedf557a935f956b017a6946d7&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><pubDate>Tue, 23 Dec 2008 02:12:16 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/help-test-jquery-13-beta-1.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=134</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/help-test-jquery-13-beta-1.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678171/5006247</fs:itemid></item><item><title>[推荐]jQuery 源码分析</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678172/5006247/1/item.html</link><content:encoded>&lt;p&gt;不得不承认，我看到这个帖子晚了好几个月。&lt;br /&gt;
但幸运的是，我在年末的时候看到了。Better late than never.&lt;br /&gt;
就当作圣诞礼物送给我自己吧。&lt;br /&gt;
也送给各位：&lt;br /&gt;
&lt;a href=&quot;http://jljlpch.javaeye.com/blog/234218&quot;&gt;http://jljlpch.javaeye.com/blog/234218&lt;/a&gt;&lt;br /&gt;
非常全面得分析了jQuery 1.2.6&lt;br /&gt;
100多页的pdf文档，引用fins的话是，这是今年JavaEye上精华中的精华了。&lt;br /&gt;
没看过的请务必去看一下。&lt;/p&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/f6ffca9a09960f18a0868df40d6b73f4&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/f6ffca9a09960f18a0868df40d6b73f4/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=7ef2b9f67adfde47497cf87dd38bcc98&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=7ef2b9f67adfde47497cf87dd38bcc98&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=147a897142e2f6611bb9b952586dbf58&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=147a897142e2f6611bb9b952586dbf58&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/%e8%bd%ac%e8%bd%bdjquery-%e6%ba%90%e7%a0%81%e5%88%86%e6%9e%90.html/feed</wfw:commentRss><description>不得不承认，我看到这个帖子晚了好几个月。
但幸运的是，我在年末的时候看到了。Better late than never.
就当作圣诞礼物送给我自己吧。
也送给各位：
http://jljlpch.javaeye.com/blog/234218
非常全面得分析了jQuery 1.2.6
100多页的pdf文档，引用fins的话是，这是今年JavaEye上精华中的精华了。
没看过的请务必去看一下。&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/f6ffca9a09960f18a0868df40d6b73f4&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/f6ffca9a09960f18a0868df40d6b73f4/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=7ef2b9f67adfde47497cf87dd38bcc98&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=7ef2b9f67adfde47497cf87dd38bcc98&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=147a897142e2f6611bb9b952586dbf58&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=147a897142e2f6611bb9b952586dbf58&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>分析</category><category>jQuery</category><category>源码</category><pubDate>Mon, 22 Dec 2008 13:18:29 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/%e8%bd%ac%e8%bd%bdjquery-%e6%ba%90%e7%a0%81%e5%88%86%e6%9e%90.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=133</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/%e8%bd%ac%e8%bd%bdjquery-%e6%ba%90%e7%a0%81%e5%88%86%e6%9e%90.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678172/5006247</fs:itemid></item><item><title>json2select</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678173/5006247/1/item.html</link><content:encoded>&lt;p&gt;这是我之前为了&lt;a href=&quot;http://www.thinksns.com&quot;&gt;ThinkSNS&lt;/a&gt;写的一个小工具。通过json生成无限联动的select。至少要求jQuery 1.2.3 以上，因为我用了data方法。&lt;br /&gt;
&lt;a href=&quot;http://shawphy.googlecode.com/svn/javascript/json2select/json2select.html&quot;&gt;查看DEMO&lt;/a&gt; &lt;a href=&quot;http://shawphy.googlecode.com/svn/javascript/json2select/json2select.js&quot;&gt;源文件&lt;/a&gt; &lt;a href=&quot;http://shawphy.googlecode.com/svn/javascript/json2select/json2select.min.js&quot;&gt;min版&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//构建如下json，t为列表框的text,v为列表框的value，s表示子一级对象&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Green;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;json&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;欧洲某地&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;欧洲&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;中国某地&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;中国&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;上海&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;上海&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;云南某地&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;云南&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&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=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&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=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;大理&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&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=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;大理&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&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=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;日本某地&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;日本&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;东京&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;东京&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;北海道&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;北海道&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;s&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&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=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&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=&quot;color: Blue;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;北海道的某个地方&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&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=&quot;color: Blue;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;北海道的某个地方&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&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=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//调用即可&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;#selectt&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;json2select&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;json&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;中国&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;云南&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;大理&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;另外，如果用1.2.1的也想用的话，可以手动提取1.2.6里的data方法，或者简单用下面的模拟一下即可&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; $.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; $.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: Maroon;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;})(&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;jQuery&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/8bb281a9209ad5f70e2360a5401aa5b2&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/8bb281a9209ad5f70e2360a5401aa5b2/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=aa2885759ec382cb836558bcbd300bdd&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=aa2885759ec382cb836558bcbd300bdd&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=6586b2dfa194eca4c4d149ef268c2c9d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=6586b2dfa194eca4c4d149ef268c2c9d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/json2select.html/feed</wfw:commentRss><description>这是我之前为了ThinkSNS写的一个小工具。通过json生成无限联动的select。至少要求jQuery 1.2.3 以上，因为我用了data方法。
查看DEMO 源文件 min版
//构建如下json，t为列表框的text,v为列表框的value，s表示子一级对象
var&amp;#160;json=[
&amp;#160; &amp;#160; {
&amp;#160; &amp;#160; &amp;#160; &amp;#160; t:&amp;#34;欧洲某地&amp;#34;,
&amp;#160; &amp;#160; &amp;#160; &amp;#160; v:&amp;#34;欧洲&amp;#34;
&amp;#160; &amp;#160; },
&amp;#160; &amp;#160; {
&amp;#160; &amp;#160; &amp;#160; &amp;#160; t:&amp;#34;中国某地&amp;#34;,
&amp;#160; &amp;#160; &amp;#160; &amp;#160; v:&amp;#34;中国&amp;#34;,
&amp;#160; &amp;#160; &amp;#160; &amp;#160; s:[
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; {
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; t:&amp;#34;上海&amp;#34;,
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; v:&amp;#34;上海&amp;#34;
&amp;#160; &amp;#160; &amp;#160; [...]&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/8bb281a9209ad5f70e2360a5401aa5b2&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/8bb281a9209ad5f70e2360a5401aa5b2/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=aa2885759ec382cb836558bcbd300bdd&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=aa2885759ec382cb836558bcbd300bdd&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=6586b2dfa194eca4c4d149ef268c2c9d&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=6586b2dfa194eca4c4d149ef268c2c9d&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><category>插件</category><category>JavaScript</category><pubDate>Sat, 20 Dec 2008 13:57:17 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/json2select.html#comments</comments><guid isPermaLink="false">http://shawphy.com/2008/12/json2select.html</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/json2select.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678173/5006247</fs:itemid></item><item><title>FireUnit:基于Firebug的JavaScript单元测试扩展</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678174/5006247/1/item.html</link><content:encoded>&lt;p&gt;John Resig最近在他的博客中发表文章&lt;a href=&quot;http://ejohn.org/blog/fireunit/&quot;&gt;John Resig -   FireUnit: JavaScript Unit Testing Extension&lt;/a&gt;.发布了他与&lt;a href=&quot;http://www.softwareishard.com/&quot;&gt;Jan Odvarko&lt;/a&gt;合作开发的一款基于Firebug的扩展&lt;a href=&quot;http://fireunit.org/&quot;&gt;FireUnit&lt;/a&gt;。(Firebug真是越来越强大了……)&lt;br /&gt;
简单说来，FireUnit给Firebug增加了一个标签面板，并提供了一些简单的JavaScript API来记录和查看测试。&lt;br /&gt;
举例来说：&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// Simple true-like/false-like testing&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;ok&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;I'm going to pass!&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;ok&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;I'm going to fail!&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// Compare two strings - shows a diff of the&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// results if they're different&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;compare&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;The lazy fox jumped over the log.&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;The lazy brown fox jumped the log.&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;Are these two strings the same?&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// Compare a string using a regular expression&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;reCompare&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;The .* fox jumped the log.&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;The lazy brown fox jumped the log.&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;Compare a string using a RegExp.&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// Display the total results&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;testDone&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;就可以在Firebug中的Test标签面板中看到下图：&lt;/p&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://ejohn.org/blog/fireunit/&quot;&gt;&lt;img src=&quot;http://fireunit.org/fireunit-1.png&quot; alt=&quot;fireunit测试&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;FireUnit还可以模拟触发原生浏览器事件：&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// You can also simulate browser events&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Green;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: Teal;&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;getElementsByTagName&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)[&lt;/span&gt;&lt;span style=&quot;color: Maroon;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;mouseDown&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;focus&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;key&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;此外，可以批量测试文件（每个文件都含有一些独立测试）&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// Or run multiple pages of tests:&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;runTests&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;test2.html&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;test3.html&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;// Place at the end of every test file in order to continue&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;testDone&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://ejohn.org/blog/fireunit/&quot;&gt;&lt;img src=&quot;http://www.softwareishard.com/images/posts/fireunit/fireunit-ui-thumb.png&quot; alt=&quot;fireunit批量测试&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;推荐把测试代码包含在下面的if语句内&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Green;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;typeof&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;fireunit&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; === &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//Your code for test&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;如果感兴趣，可以访问&lt;a href=&quot;http://fireunit.org/&quot;&gt;Fireunit.org&lt;/a&gt;下载并测试（这个网站内就包含了测试代码，安装后即可看到第一张图的内容）&lt;br /&gt;
可以在Github上获取&lt;a href=&quot;http://github.com/jeresig/fireunit&quot;&gt;源码&lt;/a&gt;，得用git而不是svn&lt;br /&gt;
Jan也写了一篇&lt;a href=&quot;http://www.softwareishard.com/blog/firebug/fireunit-testing-in-the-firebug-world/&quot;&gt;文章&lt;/a&gt;，可以看看。&lt;/p&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/70e9193d35614ac6db8bdb8bcfdc2aed&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/70e9193d35614ac6db8bdb8bcfdc2aed/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=87210ca781d98f35a793de6cf580f381&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=87210ca781d98f35a793de6cf580f381&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=1cf324b2d3ef1b8c099c223d148f3d82&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=1cf324b2d3ef1b8c099c223d148f3d82&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/fireunit.html/feed</wfw:commentRss><description>John Resig最近在他的博客中发表文章John Resig -   FireUnit: JavaScript Unit Testing Extension.发布了他与Jan Odvarko合作开发的一款基于Firebug的扩展FireUnit。(Firebug真是越来越强大了……)
简单说来，FireUnit给Firebug增加了一个标签面板，并提供了一些简单的JavaScript API来记录和查看测试。
举例来说：
// Simple true-like/false-like testing
fireunit.ok(&amp;#160;true, &amp;#34;I'm going to pass!&amp;#34; );
fireunit.ok(&amp;#160;false, &amp;#34;I'm going to fail!&amp;#34; );
&amp;#160;
// Compare two strings - shows a diff of the
// results if they're different
fireunit.compare(
&amp;#160; &amp;#34;The lazy fox jumped over the log.&amp;#34;,
&amp;#160; &amp;#34;The lazy brown fox jumped the log.&amp;#34;,
&amp;#160; &amp;#34;Are these [...]&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/70e9193d35614ac6db8bdb8bcfdc2aed&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/70e9193d35614ac6db8bdb8bcfdc2aed/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=87210ca781d98f35a793de6cf580f381&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=87210ca781d98f35a793de6cf580f381&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=1cf324b2d3ef1b8c099c223d148f3d82&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=1cf324b2d3ef1b8c099c223d148f3d82&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>Firebug</category><category>FireUnit</category><category>JavaScript</category><category>Firefox</category><pubDate>Thu, 18 Dec 2008 16:43:15 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/fireunit.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=128</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/fireunit.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678174/5006247</fs:itemid></item><item><title>jQuery中不为人知的秘密之三——判断元素上是否绑定了事件</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678175/5006247/1/item.html</link><content:encoded>&lt;p&gt;好久没写博客了，抱歉抱歉，最近半年很忙很忙。&lt;br /&gt;
正好群里  &lt;a href=&quot;http://qleelulu.cnblogs.com/&quot;&gt;Q.Lee.lulu&lt;/a&gt; 问起怎样判断有没有绑定一个事件。&lt;br /&gt;
我研究了一下之后发现，jQuery都将事件缓存起来了，其实也是为了防止内存溢出以及页面unload的时候的速度，也包括多函数触发，方便管理等诸多好处，具体可以参考&lt;a href=&quot;http://jljlpch.javaeye.com/blog/232932&quot;&gt;此文&lt;/a&gt;。&lt;br /&gt;
jQuery会在window.unload的时候卸载所有绑定过的事件，释放内存的。&lt;/p&gt;
&lt;p&gt;OK，言归正传。判断元素上是否绑定过事件用如下语句&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Blue;&quot;&gt;jQuery&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;elem&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;events&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)[&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//老版本也能用&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;elem&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;events&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)[&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//1.2.3以后才能用&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;返回值：&lt;br /&gt;
	一个Object，可以用for in来遍历。或者undefined。&lt;br /&gt;
参数：&lt;br /&gt;
	elem是一个DOM对象，type是事件类型。&lt;br /&gt;
举例：&lt;br /&gt;
	判断id为foo的元素上是否绑定了click事件&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Green;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; $&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;#foo&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;events&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)[&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;){&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//your code&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/ae60cff5e9dca63306c4bf19ad3b3cd4&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/ae60cff5e9dca63306c4bf19ad3b3cd4/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=3521e44cc4acee631cb144466fd86120&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=3521e44cc4acee631cb144466fd86120&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=f2e975a4017c70f53e7e68a57c8097c8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=f2e975a4017c70f53e7e68a57c8097c8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/the-missing-manual-in-jquery-3-whether-a-element-has-been-binded-a-event-handler-to.html/feed</wfw:commentRss><description>好久没写博客了，抱歉抱歉，最近半年很忙很忙。
正好群里  Q.Lee.lulu 问起怎样判断有没有绑定一个事件。
我研究了一下之后发现，jQuery都将事件缓存起来了，其实也是为了防止内存溢出以及页面unload的时候的速度，也包括多函数触发，方便管理等诸多好处，具体可以参考此文。
jQuery会在window.unload的时候卸载所有绑定过的事件，释放内存的。
OK，言归正传。判断元素上是否绑定过事件用如下语句
jQuery.data(elem,&amp;#34;events&amp;#34;)[type]&amp;#160; //老版本也能用
$(elem).data(&amp;#34;events&amp;#34;)[type]&amp;#160; //1.2.3以后才能用
返回值：
	一个Object，可以用for in来遍历。或者undefined。
参数：
	elem是一个DOM对象，type是事件类型。
举例：
	判断id为foo的元素上是否绑定了click事件
if( $(&amp;#34;#foo&amp;#34;).data(&amp;#34;events&amp;#34;)[&amp;#34;click&amp;#34;] ){
&amp;#160; &amp;#160; //your code
}&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/ae60cff5e9dca63306c4bf19ad3b3cd4&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/ae60cff5e9dca63306c4bf19ad3b3cd4/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=3521e44cc4acee631cb144466fd86120&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=3521e44cc4acee631cb144466fd86120&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=f2e975a4017c70f53e7e68a57c8097c8&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=f2e975a4017c70f53e7e68a57c8097c8&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><pubDate>Wed, 17 Dec 2008 16:26:37 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/the-missing-manual-in-jquery-3-whether-a-element-has-been-binded-a-event-handler-to.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=127</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/the-missing-manual-in-jquery-3-whether-a-element-has-been-binded-a-event-handler-to.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678175/5006247</fs:itemid></item><item><title>“另类”的阻止冒泡</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678176/5006247/1/item.html</link><content:encoded>&lt;p&gt;论坛里有人问&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: red;&quot;&gt;HTML:&lt;/span&gt;&lt;br /&gt;
&amp;lt;div id=&amp;#8221;b&amp;#8221;&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;sssssssssssss&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;aaaaaaaaaaaa&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: red;&quot;&gt;JQ;&lt;/span&gt;&lt;br /&gt;
$(&amp;#8217;div:contains(aaa)&amp;#8217;).addClass(&amp;#8217;aa&amp;#8217;);&lt;/p&gt;
&lt;p&gt;如何才能让这个id=&amp;#8221;b&amp;#8221;的div不要被选择器匹配到呢？&lt;/p&gt;
&lt;p&gt;底下讨论了老半天基本都是无解，只能回避这个问题，加入class之类的限定条件。&lt;/p&gt;
&lt;p&gt;后来我仔细翻了翻API，发现还有filter这个方法可以用。&lt;/p&gt;
&lt;p&gt;之后还不过瘾，写了个选择器插件，需要的同学可以拿去用。&lt;/p&gt;
&lt;p&gt;直接上代码了，写的不好，有能力的帮忙优化一下，毕竟选择器函数属于运算密集型函数。&lt;br /&gt;
filter方法：&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;div:contains(aaa)&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; $&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;children&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: Maroon;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;})&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;选择器插件：&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;shawphy&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;this is a demo -- shawphy&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;/*&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Shawphy:用于查找不含子元素的元素（可以包含文本，不同于:empty选择器）&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;*/&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;extend&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;expr&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&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=&quot;color: Blue;&quot;&gt;nochild&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; : &lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&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=&quot;color: Green;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; $&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;children&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: Maroon;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//Shawphy:子元素数量为0的元素会被保留&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&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=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;})&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;})(&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;jQuery&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//Shawphy:测试是否能查到所需要的东西&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;alert&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;div:contains(shawphy):nochild&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;length&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/cf86b3b65fccfa85ca6050b9d9bfb4a7&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/cf86b3b65fccfa85ca6050b9d9bfb4a7/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=7d6035f7ffda32cc250ad5bf8eaeb63b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=7d6035f7ffda32cc250ad5bf8eaeb63b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=d7d6d79b18db83206c285e3b7726665f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=d7d6d79b18db83206c285e3b7726665f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/12/jquery-nochild-selector.html/feed</wfw:commentRss><description>论坛里有人问
HTML:
&amp;#60;div id=&amp;#8221;b&amp;#8221;&amp;#62;
&amp;#60;div&amp;#62;sssssssssssss&amp;#60;/div&amp;#62;
&amp;#60;div&amp;#62;aaaaaaaaaaaa&amp;#60;/div&amp;#62;
&amp;#60;/div&amp;#62;
JQ;
$(&amp;#8217;div:contains(aaa)&amp;#8217;).addClass(&amp;#8217;aa&amp;#8217;);
如何才能让这个id=&amp;#8221;b&amp;#8221;的div不要被选择器匹配到呢？
底下讨论了老半天基本都是无解，只能回避这个问题，加入class之类的限定条件。
后来我仔细翻了翻API，发现还有filter这个方法可以用。
之后还不过瘾，写了个选择器插件，需要的同学可以拿去用。
直接上代码了，写的不好，有能力的帮忙优化一下，毕竟选择器函数属于运算密集型函数。
filter方法：
$('div:contains(aaa)').filter(function() {
&amp;#160; &amp;#160; &amp;#160; return $(this).children().length == 0;
});
选择器插件：
&amp;#60;div&amp;#62;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#60;div&amp;#62;shawphy&amp;#60;/div&amp;#62;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#60;div&amp;#62;this is a demo -- shawphy&amp;#60;/div&amp;#62;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#60;div&amp;#62;test&amp;#60;/div&amp;#62;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#60;div&amp;#62;test&amp;#60;/div&amp;#62;
&amp;#60;/div&amp;#62;
/*
&amp;#160; &amp;#160; &amp;#160; &amp;#160; Shawphy:用于查找不含子元素的元素（可以包含文本，不同于:empty选择器）
*/
&amp;#160; &amp;#160; &amp;#160; &amp;#160; ;(function($)&amp;#160;{
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; $.extend($.expr[&amp;#34;:&amp;#34;], {
&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; [...]&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/cf86b3b65fccfa85ca6050b9d9bfb4a7&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/cf86b3b65fccfa85ca6050b9d9bfb4a7/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=7d6035f7ffda32cc250ad5bf8eaeb63b&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=7d6035f7ffda32cc250ad5bf8eaeb63b&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=d7d6d79b18db83206c285e3b7726665f&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=d7d6d79b18db83206c285e3b7726665f&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><pubDate>Sat, 13 Dec 2008 01:58:30 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/12/jquery-nochild-selector.html#comments</comments><guid isPermaLink="false">http://shawphy.com/2008/12/%e2%80%9c%e5%8f%a6%e7%b1%bb%e2%80%9d%e7%9a%84%e9%98%bb%e6%ad%a2%e5%86%92%e6%b3%a1.html</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/12/jquery-nochild-selector.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678176/5006247</fs:itemid></item><item><title>jQuery中不为人知的秘密之二</title><link>http://item.feedsky.com/~feedsky/shawphy/~7082778/156678177/5006247/1/item.html</link><content:encoded>&lt;p&gt;又开始写jQuery的秘密了~&lt;br /&gt;
这里写的基本上都是没啥用的东西，大家随便看看好了，有用的都放在文档里了~&lt;/p&gt;
&lt;p&gt;这回先说选择器，&lt;br /&gt;
两个特殊的选择器，没有在文档里列出来。有可能只是选择器正则匹配的失误，也可能是故意的，但我源码中看不出来。望各位看官指点。注意，下面两个特殊选择器，随时可能在以后版本中消失，慎用。本文涉及的是1.2.6，经测试1.2.3也可使用。&lt;/p&gt;
&lt;p&gt;创建一个空jQuery对象：&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//切记，引号中间至少有_一个_空格&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;这段简易的代码即可创建一个空的jQuery对象。这就类似创建一个代码片段。但由于是空的，所以无法append进任何东西。但你可以用add将你要的东西添加进去。&lt;/p&gt;
&lt;p&gt;获取document，有时候需要写一些关于document的事件，比如keypress之类的，或者其他的，就可以用&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//切记，引号中间_没有_空格&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;这一定程度上可以用于混淆代码，比如将$(document).ready()写成$(&amp;#8221;&quot;).ready()，不知道的人就看不懂了。当然，要看过本文的人就都知道了~~（笑~）&lt;/p&gt;
&lt;p&gt;顺便一说，前端加密是没有可能的，混淆也是有限度的。有jQuery的操作是链式操作，没有中间变量，同时通常绑定函数也是匿名函数，所以对于jQuery代码的混淆更是没有太大用处。除非，不再使用匿名函数，每次都外部定义一个。同时不再使用链式操作，用next，parent之类操作的时候，统统再定义一个中间变量。这样你的jQuery代码已经没有jQuery风格了，对混淆会稍微有点点帮助。注意，以上所有混淆操作，只防君子不防小人！切记，前端开发不可能加密！所以一切都做好开源的准备！了解GPL、MIT之类的都是有必要的！&lt;/p&gt;
&lt;p&gt;如果你要用中间变量,像前面说的为了混淆，有时候你可能需要用到之前的一个对象，就好像在链式写法中用end()的效果，那就可以用prevObject属性，end()就是返回这个属性。&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;#id&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;prevObject&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #ffa500;&quot;&gt;//切记，最后没有括号，这个是属性不是方法&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;下面说的这个其实不是很秘密，但值得一提&lt;br /&gt;
attr是很伟大的方法，以下这些都是可以执行的，你就可以通过这些来进行一些简单的判断，比如这个元素的标签名啦之类的。&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;tagName&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;nodeName&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;attr&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Red;&quot;&gt;nodeType&lt;/span&gt;&lt;span style=&quot;color: #8b0000;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;还有个相关的，他返回的是布尔值true/false&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Blue;&quot;&gt;jQuery&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;nodeName&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;elem&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;nodeName&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;第一个参数是一个DOM对象，不是jQuery对象，第二个就是节点名称（标签名）了，大小写无关。返回true/false&lt;br /&gt;
有人问，为什么我不直接使用elem.nodeName==nodeName呢，爱用写这么麻烦呢？&lt;br /&gt;
看一下jQuery的源码就知道了&lt;/p&gt;
&lt;div class=&quot;hl-surround&quot;&gt;&lt;ol class=&quot;hl-main ln-show&quot; title=&quot;Double click to hide line number.&quot; ondblclick = &quot;linenumber(this)&quot;&gt;&lt;li class=&quot;hl-firstline&quot;&gt;&lt;span style=&quot;color: Blue;&quot;&gt;nodeName&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;elem&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: Green;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;elem&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;nodeName&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;elem&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;nodeName&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt; == &lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: Blue;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span style=&quot;color: Olive;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: Olive;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: Gray;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;
&lt;p&gt;明白了么？浏览器兼容性问题，某些浏览器中的nodeName是大写，有些是小写，够恶心吧？&lt;br /&gt;
兼容一下总是好的~~&lt;/p&gt;&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/df36835dc1a956bbbe079ca8d1af9d93&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/df36835dc1a956bbbe079ca8d1af9d93/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=a50c1eebb63a6603dc4b98636b3d1ab4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=a50c1eebb63a6603dc4b98636b3d1ab4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=6ebcc2b9347fc8c8615c63d52e46df39&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=6ebcc2b9347fc8c8615c63d52e46df39&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</content:encoded><wfw:commentRss>http://shawphy.com/2008/08/the-missing-manual-in-jquery-2.html/feed</wfw:commentRss><description>又开始写jQuery的秘密了~
这里写的基本上都是没啥用的东西，大家随便看看好了，有用的都放在文档里了~
这回先说选择器，
两个特殊的选择器，没有在文档里列出来。有可能只是选择器正则匹配的失误，也可能是故意的，但我源码中看不出来。望各位看官指点。注意，下面两个特殊选择器，随时可能在以后版本中消失，慎用。本文涉及的是1.2.6，经测试1.2.3也可使用。
创建一个空jQuery对象：
$(&amp;#34; &amp;#34;);&amp;#160;&amp;#160; //切记，引号中间至少有_一个_空格
这段简易的代码即可创建一个空的jQuery对象。这就类似创建一个代码片段。但由于是空的，所以无法append进任何东西。但你可以用add将你要的东西添加进去。
获取document，有时候需要写一些关于document的事件，比如keypress之类的，或者其他的，就可以用
$(&amp;#34;&amp;#34;);&amp;#160;&amp;#160; //切记，引号中间_没有_空格
这一定程度上可以用于混淆代码，比如将$(document).ready()写成$(&amp;#8221;&quot;).ready()，不知道的人就看不懂了。当然，要看过本文的人就都知道了~~（笑~）
顺便一说，前端加密是没有可能的，混淆也是有限度的。有jQuery的操作是链式操作，没有中间变量，同时通常绑定函数也是匿名函数，所以对于jQuery代码的混淆更是没有太大用处。除非，不再使用匿名函数，每次都外部定义一个。同时不再使用链式操作，用next，parent之类操作的时候，统统再定义一个中间变量。这样你的jQuery代码已经没有jQuery风格了，对混淆会稍微有点点帮助。注意，以上所有混淆操作，只防君子不防小人！切记，前端开发不可能加密！所以一切都做好开源的准备！了解GPL、MIT之类的都是有必要的！
如果你要用中间变量,像前面说的为了混淆，有时候你可能需要用到之前的一个对象，就好像在链式写法中用end()的效果，那就可以用prevObject属性，end()就是返回这个属性。
$(&amp;#34;#id&amp;#34;).prevObject;&amp;#160;&amp;#160; //切记，最后没有括号，这个是属性不是方法
下面说的这个其实不是很秘密，但值得一提
attr是很伟大的方法，以下这些都是可以执行的，你就可以通过这些来进行一些简单的判断，比如这个元素的标签名啦之类的。
$(&amp;#34;body&amp;#34;).attr(&amp;#34;tagName&amp;#34;);
$(&amp;#34;body&amp;#34;).attr(&amp;#34;nodeName&amp;#34;);
$(&amp;#34;body&amp;#34;).attr(&amp;#34;nodeType&amp;#34;);
还有个相关的，他返回的是布尔值true/false
jQuery.nodeName( elem, nodeName )
第一个参数是一个DOM对象，不是jQuery对象，第二个就是节点名称（标签名）了，大小写无关。返回true/false
有人问，为什么我不直接使用elem.nodeName==nodeName呢，爱用写这么麻烦呢？
看一下jQuery的源码就知道了
nodeName: function( elem, name ) {
&amp;#160; &amp;#160; return&amp;#160;elem.nodeName &amp;#38;&amp;#38; elem.nodeName.toUpperCase() == name.toUpperCase();
},
明白了么？浏览器兼容性问题，某些浏览器中的nodeName是大写，有些是小写，够恶心吧？
兼容一下总是好的~~&lt;br /&gt;&lt;!-- Feedsky ad --&gt;&lt;a href=&quot;http://feed.feedsky.com/~cpm/c/shawphy/df36835dc1a956bbbe079ca8d1af9d93&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~cpm/shawphy/df36835dc1a956bbbe079ca8d1af9d93/s.gif&quot; border=&quot;0&quot; style=&quot;margin-top:5px;&quot; /&gt;&lt;/a&gt;&lt;!-- /Feedsky ad --&gt;&lt;br /&gt;&lt;!-- Feedsky flare --&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=a50c1eebb63a6603dc4b98636b3d1ab4&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=a50c1eebb63a6603dc4b98636b3d1ab4&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://feed.feedsky.com/~flare/shawphy?a=6ebcc2b9347fc8c8615c63d52e46df39&quot; target=&quot;_blank&quot;&gt;&lt;img src=&quot;http://feed.feedsky.com/~flare/shawphy?i=6ebcc2b9347fc8c8615c63d52e46df39&quot; border=&quot;0&quot;&gt;&lt;/a&gt;&lt;!-- /Feedsky flare --&gt;</description><category>jQuery</category><pubDate>Sun, 10 Aug 2008 19:13:56 +0800</pubDate><author>Shawphy</author><comments>http://shawphy.com/2008/08/the-missing-manual-in-jquery-2.html#comments</comments><guid isPermaLink="false">http://shawphy.com/?p=79</guid><dc:creator>Shawphy</dc:creator><fs:srclink>http://shawphy.com/2008/08/the-missing-manual-in-jquery-2.html</fs:srclink><fs:srcfeed>http://shawphy.com/feed</fs:srcfeed><fs:itemid>feedsky/shawphy/~7082778/156678177/5006247</fs:itemid></item></channel></rss>