<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hello,JavaScript</title>
	<atom:link href="http://www.html-js.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.html-js.com</link>
	<description>关注学习前端技术,前端开发,前端,JavaScript,css,html,js,前台,ued,视觉设计(这就是seo?)</description>
	<lastBuildDate>Thu, 02 Sep 2010 01:56:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>发布两个前端的小工具</title>
		<link>http://www.html-js.com/?p=703</link>
		<comments>http://www.html-js.com/?p=703#comments</comments>
		<pubDate>Thu, 02 Sep 2010 01:56:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[开发工具]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=703</guid>
		<description><![CDATA[http://www.html-js.com/my-js/version0.0.1/tool/ 请在此地址随时关注我要发布的前端工具. 第一个工具是html结构转换成用+相连的js换行字符串工具 作用就是把输进去的html结构变成js中可用的字符串形式,同... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.html-js.com/my-js/version0.0.1/tool/">http://www.html-js.com/my-js/version0.0.1/tool/</a></p>
<p>请在此地址随时关注我要发布的前端工具.</p>
<p>第一个工具是<a href="http://www.html-js.com/my-js/version0.0.1/tool/html2string.html">html结构转换成用+相连的js换行字符串工具</a></p>
<p>作用就是把输进去的html结构变成js中可用的字符串形式,同时保留格式.</p>
<p>第二个工具是<a href="http://www.html-js.com/my-js/version0.0.1/tool/css-format.html">css属性排序工具</a></p>
<p>作用是把输入的css样式的属性按照首字母排序,生成的css可能会方便查询.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=703</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>前端性能优化小汇总（第一节 一段对话）</title>
		<link>http://www.html-js.com/?p=692</link>
		<comments>http://www.html-js.com/?p=692#comments</comments>
		<pubDate>Thu, 19 Aug 2010 11:00:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[前端优化]]></category>
		<category><![CDATA[性能]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=692</guid>
		<description><![CDATA[转载请注明：http://www.html-js.com/?p=692 问题由淘宝前端群里的一次小讨论开始，有一天，玉伯在群里突然喊了一个问题，问题如下： YSlow 性能优化的第一条原则是：减少 HTTP 链接数 一问：为什么... ]]></description>
			<content:encoded><![CDATA[<div class="copyright">转载请注明：<a href="http://www.html-js.com/?p=692">http://www.html-js.com/?p=692</a></div>
<div>
<p>问题由淘宝前端群里的一次小讨论开始，有一天，玉伯在群里突然喊了一个问题，问题如下：</p>
<div><strong>YSlow 性能优化的第一条原则是：减少 HTTP 链接数</strong></div>
<div><strong>一问：为什么？</strong></div>
<div><strong>二问：真的吗？</strong></div>
<div><strong>三问：应该怎么做？</strong></div>
<p>然后，下面我们产生了这样的讨论，不相关的讨论我做了删减：（我的总结在下一篇文章里）</p>
<div>松松</div>
<div>1：应该是指功能性的文件，css，js。至于<span style="color: #ff0000;"><strong>css sprites</strong></span>是需要非必要。</div>
<div>2：如果不减少css、js请求数，css sprites做的再好，性能优化也是大打折扣的。</div>
<div>3：Combo或者按需加载。</div>
<div><strong>(玉伯) </strong></div>
<div><strong>为什么减少http链接数，能提高性能？</strong></div>
<div><strong><span style="color: #ff0000;">（玉伯提出这个问题的根本在于：何谓前端优化？我们在做前端优化的时候应该考虑什么？不应该考虑什么？什么情况下应该考虑什么？什么情况下不应该考虑什么？）</span></strong></div>
<div>崇厚</div>
<div>这要从 HTTP，TCP，DNS 这些说起了~</div>
<div>(法海)</div>
<div>旧事重提，莫非这里面水很深？……</div>
<div>(正淳)</div>
<div>因为速度的瓶颈是下载带宽</div>
<p><span style="color: #ff0000;"><strong>（我理解，王爷的意思是 下载带宽是瓶颈，大多数浏览器同时只能下载两个资源文件，所以减少http连接数可以加快下载,当然这里不是说越少越好，都是相对的）</strong></span></p>
<div><strong>(玉伯) </strong></div>
<div><strong>@正淳：那为何不减少内容？HTTP链接数和网页大小，没啥必然联系。</strong></div>
<p><strong><span style="color: #ff0000;">（玉伯提出内容才是我们要点，我们应该更关注内容的大小）</span></strong></p>
<div>(丘迟)</div>
<div>没发起一个链接都有和服务器握手的等待时间&#8230; 这个是大头</div>
<p><strong><span style="color: #ff0000;">（丘迟提出一个性能优化的点，那就是tcp连接和服务器的握手时间消耗,但是这个的消耗应该没说的这么恐怖）</span></strong></p>
<div>(正淳)</div>
<div>因为浏览器为了不恶性循环采用了双线程下载.</div>
<p><strong><span style="color: #ff0000;">（这是第二个性能优化的点，不同浏览器的同时下载线程数限制）</span></strong></p>
<div><strong>(玉伯) </strong></div>
<div><strong>按理说，性能优化的第一原则，应该是内容优化，精简内容。为何 YSlow 将内容优化的首要原则，定位为 减少 HTTP 链接数？</strong></div>
<p><strong><span style="color: #ff0000;">（内容优先）</span></strong></p>
<div>(正淳)</div>
<div>yslow也不能控制内容啊</div>
<div><strong>(玉伯) </strong></div>
<div><strong>@丘迟：round-trip 消耗真的有这么大吗？</strong></div>
<p><strong><span style="color: #ff0000;">（round-trip应该指的是 请求的时候的dns请求，握手等消耗的时间,至于dns解析和握手是否真的消耗很小还是很大，后面的文章会讨论）</span></strong></p>
<div>建立链接就涉及到域名解析 握手 发送header  这个消耗挺大的</div>
<div>(正淳)</div>
<div>就像警察扫荡淫窝一样，管不了里面服务的内容</div>
<p><strong><span style="color: #ff0000;">（王爷的意思是yslow探测不了内容的性质）</span></strong></p>
<div>松松</div>
<div>假设google地图是个高颗粒化的JS。</div>
<div>缩放组件，缓动效果，交通实时流量、、、、、。</div>
<p>采用Combo后明显会快点，这些功能可以尽快渲染到屏幕上。<br />
<strong><span style="color: #ff0000;">（松松说的可能和玉伯的意思是相违背的，其实玉伯想说对于应用型的网页，减少http请求数并不是最优实践，我想来，其实将js分开来或许可以呈现的更快，浏览器端可以采用keeplive技术，其实说来说去，瓶颈在用户这里的加载速度）</span></strong></p>
<div>(玉伯)</div>
<div><strong>10 个链接的 round-trip 总和，一般不到 100ms</strong></div>
<div>天祁</div>
<div>我觉得对于服务器来说一个请求数耗费的是cpu资源 这个应该挺贵的。。。</div>
<p><span id="more-692"></span></p>
<div><strong>(玉伯) (9:31:35): </strong></div>
<div><strong>好了，天祁说到了一个“重点”：减少 http 链接数，可以减少 服务器的 cpu 消耗</strong></div>
<div><strong>可是，我们在做前端优化！</strong></div>
<p><strong><span style="color: #ff0000;">（我说了一个“重点”，玉伯也说了一个真正的重点：我们是在做前端优化，我们就应该专注于用户这里的情况，而不是去考虑服务器那里的问题，前端优化瓶颈就在用户这里的加载时间和渲染时间，虽然后台优化我们也需要考虑，但是不应该放在首要位置去考虑）</span></strong></p>
<div>(云谦) (9:31:50):</div>
<div>我觉得除了 block 下载 的 js 链接外，其他的连接都不是很重要，因为是并行的。</div>
<p><strong><span style="color: #ff0000;">（block的js放在首要考虑，其他方面不是很重要，不影响页面渲染，但是有时候也需要做一些考虑）</span></strong></p>
<div><strong>(玉伯) (9:32:07): </strong></div>
<div><strong>如果服务器足够强大，为何不同时并行下载呢？</strong></div>
<div>天祁 (9:32:42):</div>
<div>恩 但是 我觉得考虑这种问题 也就是类似淘宝首页这种页面 访问量巨大</div>
<p><strong><span style="color: #ff0000;">（这句话可以忽视，当时没考虑清楚）</span></strong></p>
<div><strong>(玉伯) (9:33:05): </strong></div>
<div><strong>ie6，据未经证实的统计称，大部分用户装的是 xp sp3，已经 4 个并发数 / 每 host</strong></div>
<div>(龙刚) (9:33:39):</div>
<div>@玉伯，在硬件便宜的情况下，硬件因素是否可以不作为主要的因素了？</div>
<p><strong><span style="color: #ff0000;">（龙刚这句话其实也是在表明当硬件足够强大的时候，我们应该将精力更多放在前端优化这里）</span></strong></p>
<div>松松(xiong_song) (9:34:00):</div>
<div>JS、CSS也用CDN</div>
<div>崇厚 (9:34:01):</div>
<div>硬件便宜，那是从微观上看</div>
<div>天祁 (9:34:11):</div>
<div>我觉得硬件和网速相比 还是硬件贵。。。</div>
<div><strong>大家生日乐乐(玉伯) (9:34:36): </strong></div>
<div><strong>我们可以假设硬件和服务器已经足够强壮，淘宝的cdn正在迅速增多，年底会达到30多个</strong></div>
<div><strong>(小马) (9:34:52): </strong></div>
<div><strong>其实做优化是实践，实践意味着要联系具体的环境。当淘宝的CDN偏弱主站强的时候，减少CDN的链接增大下载量是优化的目标，当淘宝CDN强主站偏弱时，优化的方向则会调整。 这是根据硬件和网络环境。  另外还要根据应用类型去分析</strong></div>
<div><strong><span style="color: #ff0000;">（小马做了总结，其实任何问题都是依照实际情况衡量出来的）</span></strong></div>
<div>博玉 (9:35:08):</div>
<div>http请求头的数据量应该也是比较重的一部分吧</div>
<div><strong>(玉伯) (9:35:29): </strong></div>
<div><strong>随着 ie6 的份额下降，甚至以后有可能和图片站点一样，增加：</strong></div>
<p><strong><br />
</strong></p>
<div><strong>a.tbcdn.cn</strong></div>
<div><strong>a2.tbcdn.cn</strong></div>
<div><strong>&#8230;</strong></div>
<div><strong>a8.tbcdn.cn</strong></div>
<p><strong><span style="color: #ff0000;">（将assets分到不同的host之下，可以提高并行下载速度）</span><br />
</strong></p>
<div><strong>(玉伯) (9:36:53): </strong></div>
<div><strong>减少 http 链接数，目前YAHOO的官方说法和讨论有以下几个原因：</strong></div>
<div><strong>1. 避免不必要的 http headers + cookies 下载量<span style="color: #ff0000;">（对于assets和cdn来说header和cookie的大小非常有限，因为和主站域名已经分离，cookie不共享）</span></strong></div>
<div><strong>2. 减少 round-trip 时间，这个也可以通过设置 keep-alive 部分解决<span style="color: #ff0000;">(keep-live可以建立一次连接后直接传输多个文件，从而减少dns解析和握手的消耗）</span></strong></div>
<div><strong>没了</strong></div>
<p><strong><br />
</strong></p>
<div><strong>(玉伯) (9:37:30): </strong></div>
<div><strong>但 1 和 2， 目前看起来，能节省的下载量和握手时间，都非常有限</strong></div>
<p><strong><br />
</strong></p>
<div><strong>(玉伯) (9:38:14): </strong></div>
<div><strong>还有一个主要因素是，YAHOO 是以内容展现为主的 web pages 为主对于 web pages 来说，将 scripts 全部搞在一块，最后下载，是个不错的选择因为用户主要是来 “看” 网页内容的</strong></div>
<div><strong>大家生日乐乐(玉伯) (9:39:25): </strong></div>
<div><strong>当用户逐步由 “看” 网页 转换为 “用” 网页时， </strong></div>
<div><strong>script 甚至比 页面内容更重要</strong></div>
<div><strong>因此 YSlow 里，将 script 放 bottom 里的做法，会越来越不妥</strong></div>
<div><strong>combo scripts 的做法，也将被质疑</strong></div>
<div><strong>web pages （内容为主） -&gt;  web apps（交互为主） 这个转变将导致不少优化法则要变革</strong></div>
<div><strong>包括我们目前喜欢什么脚本操作都放在 domready 里的做法</strong></div>
<div><strong><span style="color: #ff0000;">（内容和交互对于前端优化来说到底有什么影响呢？</span></strong></div>
<div><strong><span style="color: #ff0000;">以内容为主的网站，例如：yahoo门户，这种网站需要展示给用户的是内容，脚本即使产生延迟也不会对整体的阅读产生过大的影响，所以优化原则里，将script放在一块，将script放在底部。</span></strong></div>
<div><strong><span style="color: #ff0000;">以交互为主的网站，以功能为重，在一开始，我们就需要功能运行起来，这样才能给用户提供最小的延迟，然后我们也可以先让核心功能运行起来，然后异步加载，慢慢让辅助功能运行起来）</span></strong></div>
<div>天祁 (9:41:47):</div>
<div>我懂了 内容为主和交互为主的确要考虑的情况是不同的</div>
<div><strong>(玉伯) (9:43:03): </strong></div>
<div><strong>淘宝介于这两者之间</strong></div>
<div><strong>大家一起痛并快乐着吧</strong></div>
<div><strong>http://developer.yahoo.net/blog/archives/2007/04/rule_1_make_few.html</strong></div>
<div><strong>这里有，呵呵</strong></div>
<p><strong><br />
</strong></p>
<div><strong>(小马) (9:45:52): </strong></div>
<div><strong>顶，总之一句话： 优化不是死照着规则，而是真的要仔细去了解业务，关注CDN及相关环境的进展</strong></div>
<div><strong><span><span style="color: #ff0000;">（优化就是个衡量的过程，不同的场景考虑的问题偏重不同，优化的方式就不同）</span></span></strong></div>
<p><strong> </strong></p>
<p><strong> </strong></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=692</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>转个(真实的设计师生活)</title>
		<link>http://www.html-js.com/?p=685</link>
		<comments>http://www.html-js.com/?p=685#comments</comments>
		<pubDate>Sun, 15 Aug 2010 23:56:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[生活琐事]]></category>
		<category><![CDATA[转载]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=685</guid>
		<description><![CDATA[但是我还是想当设计师，哈哈！ 设计师的悲哀 设计师很威风，不要被骗，其实他们很可怜的…… 遇到搞设计的人就嫁了吧~ 这样的设计师，你们伤害不起~ 搞设计的人，会在阳光下，站成一棵... ]]></description>
			<content:encoded><![CDATA[<div class="tip-taobao">
<h2><strong><span style="color: #ff6600;">但是我还是想当设计师，哈哈！</span></strong></h2>
</div>
<p>设计师的悲哀</p>
<p>设计师很威风，不要被骗，其实他们很可怜的……</p>
<p>遇到搞设计的人就嫁了吧~</p>
<p>这样的设计师，你们伤害不起~</p>
<p>搞设计的人，会在阳光下，站成一棵树~</p>
<p>原谅我就是这样的设计师~</p>
<p>请别爱上搞设计的人</p>
<p>每个搞设计的上辈子都是折翼的天使……</p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101631ZctBe3lwo.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101631ZctBe3lwo.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101644ZxeUeiFDj.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101644ZxeUeiFDj.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101655ZGss735WA.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101655ZGss735WA.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101706ZVzHLhtaA.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101706ZVzHLhtaA.jpg" border="0" alt="view full artical" /></a><br />
<span id="more-685"></span><br />
<a href="http://www.zgjfsj.com/images/UpImage/20100809101716ZgzmiEr2j.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101716ZgzmiEr2j.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101725Zsq2ozNdd.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101725Zsq2ozNdd.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101733Zmw3uTSsD.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101733Zmw3uTSsD.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101740ZNmkN7xP9.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101740ZNmkN7xP9.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101749ZmeJUy6av.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101749ZmeJUy6av.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101757ZnOeYeEJg.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101757ZnOeYeEJg.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101805Zo2cm4cni.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101805Zo2cm4cni.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101814ZUgj9T5h5.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101814ZUgj9T5h5.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101822ZaevG4nwc.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101822ZaevG4nwc.jpg" border="0" alt="view full artical" /></a></p>
<p><a href="http://www.zgjfsj.com/images/UpImage/20100809101830ZkgTawoAs.jpg" target="_blank"><img src="http://www.zgjfsj.com/images/UpImage/20100809101830ZkgTawoAs.jpg" border="0" alt="view full artical" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=685</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>firefox 3.5.11的一个bug</title>
		<link>http://www.html-js.com/?p=673</link>
		<comments>http://www.html-js.com/?p=673#comments</comments>
		<pubDate>Thu, 05 Aug 2010 09:36:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[hidden]]></category>
		<category><![CDATA[input]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=673</guid>
		<description><![CDATA[如果你现在用的浏览器是firefox,那么请查看一下它的版本,如果是3.5.11版本的,那么恭喜你,可以亲眼看见一个bug.现在打开这个页面: http://www.html-js.com/wp-content/uploads/2010/08/firefox-input-bug.html 如果用... ]]></description>
			<content:encoded><![CDATA[<p>如果你现在用的浏览器是firefox,那么请查看一下它的版本,如果是3.5.11版本的,那么恭喜你,可以亲眼看见一个bug.现在打开这个页面:</p>
<p><a href="http://www.html-js.com/wp-content/uploads/2010/08/firefox-input-bug.html" target="_blank">http://www.html-js.com/wp-content/uploads/2010/08/firefox-input-bug.html</a></p>
<p>如果用的是其他浏览器,ie所有版本,chrome, opera,  那么你看到的大致都是相同的景象,那就是六个输入框.</p>
<p>如果你用其他版本的firefox,你看到的应该也是六个输入框,这个我没有测试,但是如果你的firefox是3.5.11版本的,你看到的就不是六个输入框了,而是很多输入框,他们有大有小,各式各样,让人很摸不着头脑,下面就做个分析.</p>
<p>之所以出现这个问题,是因为firefox(下面的firefox都是指3.5.11版本的,至于这个bug维持到哪个版本,我也不清楚,但是3.5.11的确是这样的)在解释type=&#8221;hidden&#8221;的input的时候,如果设置了特定的css属性,type=&#8221;hidden&#8221;的input会显示出来,如果设置的属性不同,显示的样式也会千奇百怪.具体代码可以看刚才的demo的源代码,下面看一个分析图:</p>
<p><a href="http://www.html-js.com/wp-content/uploads/2010/08/firefox-input-bug.png"><img class="alignnone size-full wp-image-679" title="firefox-input-bug" src="http://www.html-js.com/wp-content/uploads/2010/08/firefox-input-bug.png" alt="" width="705" height="638" /></a></p>
<p>从上面的分析来看,这种现象真是摸不着头绪,但是如何让hidden的input显示出来还是比较明显的,那就是设置display:inline或者display:block,同时设置border,这时候type=&#8221;hidden&#8221;的input就会显示出来,至于让它显示成什么样子,可以参照上图.</p>
<p>所以在平常设置css的时候一定要注意,不要统一给input设置各种属性,要针对某个input单独设置,如果不小心给所有input都设置了border和display,firefox就会把hidden的input也显示出来,造成样式混乱,虽然听起来挺平常的,但是这个bug的确被我们遇到了.就应该多注意一下.</p>
<p>哎,如果世界上只有chrome一个浏览器多好啊.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=673</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>css的匹配性能</title>
		<link>http://www.html-js.com/?p=653</link>
		<comments>http://www.html-js.com/?p=653#comments</comments>
		<pubDate>Sat, 24 Jul 2010 01:51:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[匹配]]></category>
		<category><![CDATA[性能]]></category>
		<category><![CDATA[最佳实践]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=653</guid>
		<description><![CDATA[本文地址:http://www.html-js.com/?p=653转载请注明出处,不要删除此信息 css的匹配性能 关于CSS的匹配性能的思考!(部分内容来自网络,大部分内容自己整理) 网上关于css匹配性能的文章很多,也有很多注... ]]></description>
			<content:encoded><![CDATA[<div class="copyright">本文地址:<a href="http://www.html-js.com/?p=653">http://www.html-js.com/?p=653</a>转载请注明出处,不要删除此信息</div>
<h1>css的匹配性能</h1>
<h5>关于CSS的匹配性能的思考!(部分内容来自网络,大部分内容自己整理)</h5>
<hr />网上关于css匹配性能的文章很多,也有很多注意事项需要大家注意.这里就整理一下,顺便解释下为什么这样做可以增加匹配性能.</p>
<p>其实网上关于浏览器如何匹配css的原理也只是源于一篇MDC上的Mozilla的ui渲染原理的文章,原文地址:<a href="https://developer.mozilla.org/en/CSS/Writing_Efficient_CSS">https://developer.mozilla.org/en/CSS/Writing_Efficient_CSS</a> (英文版的,中文版可以去google搜索).</p>
<p>文中有一段话:</p>
<h4><span style="color: #333300;"><strong><span style="color: #800080;"><span style="font-style: normal;">样式系统从最右边的选择符开始向左侧移动来匹配一条规则。样式系统会一直向左匹配选择符直到规则匹配完毕或者由于出错停止匹配. </span></span></strong></span></h4>
<p>还有一段话:</p>
<p><strong><span style="color: #800080;"> 样式系统把规则分为四大类。理解这些类是很重要的，因为对于规则的匹配来说他们是首先要考虑的。之后的段落中会使用“主选择符”这个说法。<span style="text-decoration: underline;"><span style="color: #ff6600;">主选择符</span></span>是指选择符最右边的部分(最终要匹配的那个元素，而不是它的祖先元素). </span></strong></p>
<p>关于浏览器的css匹配的要旨,基本就在这两句话里面了(至少Firefox里是这样的).不过匹配的时候从右到左的顺序,也许和很多人预想的是不一样的,例如我这种人,在我的理解中,匹配是从左至右的,可能是用yui用多了,yui里面获取class的时候,先是获取父节点,然后再再里面筛选class,从左至右,所以我理解中浏览器的匹配也会是从左至右的.可是事实却是<strong>从右至左</strong>的,如果你的理解也是从左至右的,那么就要好好考虑清楚为什么浏览器会从右至左匹配,只有搞清楚了这个,以后写css的时候才会容易考虑清楚如何写才会节省性能,否则可能会按照自己的习惯想法来理所当然写css,最后在匹配性能上出问题.</p>
<p>其实从右至左的顺序也是可以很容易理解的,不论是从左至右还是从右至左都是在逐步筛选元素,之所以选用从右至左也许有其他原因,但是既然以最后一个选择符作为主选择符,那么从主选择符开始匹配就在情理之中了.</p>
<p>因为上面这两句话的原因,可以总结出下面这些css的性能提升点,我对每个提升点都做了详细的解释,理解了他们,以后就会觉得自然而然,在写css的时候自然可以写出高性能的css来.</p>
<p>首先介绍css中四种匹配规则:(注意他们的特性,这对于后面的理解很重要)</p>
<h5>ID规则</h5>
<p>ID 选择符作为主选择符的规则.</p>
<p>例如:#backButton { }</p>
<h5>CLASS规则</h5>
<p>如果一条规则有一个指定的 class 作为主选择符，就被归入此类.<br />
<span id="more-653"></span><br />
例如:</p>
<ul>
<li>button.toolbarButton { } /* 基于 class 的规则 */</li>
<li>.fancyText { } /* 基于 class 的规则 */</li>
<li>menuitem &gt; .menu-left[checked="true"] { } /* 基于 class 的规则 */</li>
</ul>
<h5>Tag 规则</h5>
<p>如果主选择符不是 ID 或者 class，那么下一个类很可能就是 tag 分类。如果一条规则指定 tag 为主选择符，就被归入此类。</p>
<p>例如：</p>
<ul>
<li>td { } /* 基于 tag 的规则 */</li>
<li>treeitem &gt; treerow { } /* 基于 tag 的规则 */</li>
<li>input[type="checkbox"] { } /* 基于 tag 的规则 */</li>
</ul>
<h5>全局规则(universal)</h5>
<p>除以上分类之外都归入此类。</p>
<p>例如：</p>
<ul>
<li>[hidden="true"] { } /* 全局规则 */</li>
<li>*{} /* 全局规则 */</li>
<li>tree &gt; [collapsed="true"] { } /* 全局规则 */</li>
</ul>
<h5>按照上面四种规则总结的最佳实践:</h5>
<h4>1.不要给 ID 分类规则指定标签名或者 class</h4>
<p>ID选择符是匹配最快的规则,ID选择符通常都是唯一的,在一个页面里出现多个重复的id是不合逻辑的,加上标签名或者class只会拖慢匹配速度.</p>
<p>这里讨论到id选择符,因为它的速度最快,所以改用id的时候还是要用的,但是并不是说用的越多越好,这个需要衡量,特别是id选择符的优先级非常高,应该权衡使用.</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" />– button#backButton { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" />– .menu-left#newMenuIcon { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– #backButton { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– #newMenuIcon { }</p>
<h6>2.不要给 class 分类规则指定标签名</h6>
<p>class用来表示一类标签,一类的标签就应该有一样的行为,除非你给他们再细分子类,但是如果在类前面添加标签,这就把类的概念混淆了,对于清晰地css来说,这样做是不合逻辑的,当然也会增加匹配的消耗.</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" />– treecell.indented { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– .treecell-indented { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" /><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– .hierarchy-deep { }</p>
<h6>3.尽量把规则应用到最明确的类上。</h6>
<p>对于css,其实我们每个人有自己的一套写法,例如,一个小模块,很多人喜欢给模块里的class命名都很简单普通,然后通过css中的后代选择器来给他们设置样式,例如:</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-4.png" alt="" width="485" height="149" /></p>
<p>这样写可以让html显得更精简,可以节省流量,但是根据这里说的匹配问题,应该避免这样写,而是应该这样写:<img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-5.png" alt="" width="495" height="160" /></p>
<p>根据上面的两条渲染原则,这样写的确可以增加匹配速度,但是如何来衡量匹配速度和html大小之间的平衡的问题上就要自己做决定了.</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" />– treeitem[mailfolder="true"] &gt; treerow &gt; treecell { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– .treecell-mailfolder { }</p>
<h6>4.避免使用通配符</h6>
<p>通配符是一个很耗费时间的规则,特别是在和其他规则混用的时候.</p>
<p>例如这样一个全局通配:</p>
<p>*{font-size:12px;}</p>
<p>且不说这样的性能如何,如果你想给某个匹配结果的所有子元素都加样式,也就是这样写:</p>
<p>.mod .hd *{font-size:14px;}</p>
<p>根据匹配顺序,将首先匹配通配符,也就是说先匹配出通配符,然后匹配.hd,然后匹配.mod,这样的性能耗费可想而知.</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" />* { font-size : 12px; }</p>
<h6>5.避免后代选择符</h6>
<p>后代选择符的耗费是很大的,应当尽量避免使用,虽然平常我们经常大量使用后代选择符,大概是因为使用后代选择符,我们需要考虑的东西会少一点,我们不用管它是不是子元素,反正是后代元素就是了.但是我们应该改变自己的这种习惯,多用子选择器.至于为什么后代选择器耗费大,因为不管是从左至右解析还是从右至左解析,子元素匹配符的确定概率总是比后代选择符的概率大得多.</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" />– treehead treerow treecell { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– treehead &gt; treerow &gt; treecell { }</p>
<h6>6.Tag 类规则中最好不要包含后代选择符</h6>
<p>避免使用具有 tag 类规则的后代选择符。这会明显地增加匹配时间（尤其是这些规则会被多次匹配时）.这一条我也没想明白,但是相对于直接使用class一步到位来说,不管是后代选择还是子选择的耗费都要高的多.</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" /> – treehead &gt; treerow &gt; treecell { }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– .treecell-header { }</p>
<h6>7.倚赖继承,了解继承</h6>
<p>了解那些可以被继承的属性,避免重复设置可以被继承的属性,从而增加解析负担和匹配负担.</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-3.png" alt="" width="16" height="16" />– #bookmarkMenuItem &gt; .menu-left { list-style-image: url(blah); }</p>
<p><img src="http://www.html-js.com/wp-content/uploads/2010/07/图像-21.png" alt="" width="21" height="19" />– #bookmarkMenuItem { list-style-image: url(blah); }<br />
这个例子里,因为很多人不知道list-style-image可以被继承,所以多写了匹配规则.</p>
<p>关于哪些元素可以被继承,那些元素不能被继承,这里就不讨论了,因为css的属性实在太多了,要靠平时来积累.</p>
<h1><span style="color: #ff0000;">其他细节问题:</span></h1>
<ul>
<li>border:none;与border:0;的区别</li>
</ul>
<p>border:o会给浏览器保留border-style,border-color等空间,所以性能上有些许差别.</p>
<ul>
<li>尽可能提供详尽的css属性</li>
<li>不宜过小的背景图片平铺</li>
</ul>
<p>过小的图片要平铺出效果来需要大量的平铺计算,是种严重的消耗.</p>
<ul>
<li>尽量不要用ie的滤镜</li>
</ul>
<p>如果实在需要在ie6中使用透明滤镜,请指定只有ie6使用此滤镜.</p>
<ul>
<li>不要用通配符解决浏览器渲染差异</li>
</ul>
<p><span style="font-weight: normal;"> 类似:*{ margin:0; padding:0;}这样的重置首先对于匹配来说是需要消耗性能的,然后就是只应该<span style="color: #ff0000;">给需要这个功能的事物赋予功能</span>,而且在重置浏览器样式的时候要注意,有些样式不要随便重置,例如:不要为了定位方便,将所有的元素设置成position:relative;要知道在ie6下relative会引起一些不常见的问题.</span></p>
<h1><span style="color: #ff0000;">对于css3和其他</span></h1>
<p>现在浏览器的效率对于目前的应用来说已经足够强,在考虑给你的网站加上新效果和渲染效率之间衡量的时候,多考虑一下css3带来的好处和效果,不要纠结于渲染效率的问题,现代浏览器都在一直改进自己的渲染效率.</p>
<p><span style="color: #ff0000;">最佳实践</span>?尽信书不如无书,在写代码或者没写代码的时候多考虑一下,也没必要非要按照上面说的做.渲染问题难以从根本来测试,也许某一条理论并不是正确的,谁知道呢.</p>
<p>速度和流量等问题需要衡量考虑,速度并不是每个网站都需要追求的极致.</p>
<h1><span style="color: #ff0000;">其他实践</span></h1>
<ul>
<li>将css代码分组,不要每次都将代码往后塞,它应该出现在什么位置,就让他出现在什么位置,否则以后要改版,只能一直往后塞代码,如果按照dom顺序,将样式代码排序,也许查找起来会更方便.</li>
<li>书写注释,将css同样当做模块对待,每个模块用注释分割,描述一下他们是做什么的,是谁写的代码,什么时候做过什么修改</li>
<li>在注释中使用特殊的字符串表示锚点,例如:每个模块的开始都用一个特定的特殊字符做标记,下次你要挨个查看模块,按下”ctrl+f”,寻找这个特殊字符,然后就可以看到一个个的模块了,让文档变得容易维护,就是这么简单.</li>
<li>命名规范,不要用数字区分同类命名,例如:可恶的div1，div2.</li>
<li>心中指定一套自己的衡量方式,以便在遇到需求的时候快速决策.其实解决一个问题并不难,难的是你能在短时间内决定用何种方式来解决这个问题.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=653</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>ABtest 前端搭建方法总结</title>
		<link>http://www.html-js.com/?p=626</link>
		<comments>http://www.html-js.com/?p=626#comments</comments>
		<pubDate>Tue, 13 Jul 2010 03:48:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[可用性研究]]></category>
		<category><![CDATA[abtest]]></category>
		<category><![CDATA[分流]]></category>
		<category><![CDATA[前端]]></category>
		<category><![CDATA[呈现]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=626</guid>
		<description><![CDATA[本文地址:http://www.html-js.com/?p=653转载请注明出处,不要删除此信息 ABtest 前端搭建方法总结 一.前言. 入职第一天,我就接到了一个从来没有听说过的任务.这个任务就是做一个abtest,使用的是阿里巴... ]]></description>
			<content:encoded><![CDATA[<div>
<p style="margin: 0px;"><span>本文地址:<a href="http://www.html-js.com/?p=653">http://www.html-js.com/?p=653</a>转载请注明出处,不要删除此信息</span></p>
<p style="margin: 0px;"><span>ABtest 前端搭建方法总结 </span></p>
<p style="margin: 0px;">
<h1 style="font-size: 18pt;"><span>一.前言.</span></h1>
<p><span style="font-size: x-small;"><br />
</span></p>
<p style="margin: 0px;"><span>入职第一天,我就接到了一个从来没有听说过的任务.这个任务就是做一个abtest,使用的是阿里巴巴的一个abtest系统,而且之前好像淘宝这边貌似没有人用过这个系统,所以我把这次测试的搭建和实现过程整理成文档,这样大家以后也好有个参考,很多问题也不必重复请教阿里巴巴的同事了。我觉得我已经够烦他们了，不过幸好他们很有耐心，让我在短时间内就成功搭建成功了这次测试。</span></p>
<h1 style="font-size: 18pt;"><span>二.abtest.</span></h1>
<p><span style="font-size: x-small;"><br />
</span></p>
<p style="margin: 0px;"><span>何为&#8221;abtest&#8221;?</span></p>
<p style="margin: 0px;"><span>顾名思义,就是ab 然后test,ab就是指两个不同的版本,我们通常称为a版本和b版本.a版本一般是指原来的版本,b版本指改版后的版本,这样约定可以在写代码的时候不至于弄混淆.这种情景通常出现在网站需要改版的时候,我们不能确定新版的网站是否会造成用户的抵制,这个时候,我们就需要做一个test来统计一下b版本的网页的改版是否是必要的和成功的.通常,abtest需要采集大量的数据,如果网站流量太小,这种测试结果没有任何意义,因为取样率不足以用统计学来解释test中出现的差异,有时候个体行为对结果干扰过大,所以在做abtest的时候一定要保证样本数量,同时还有一个要注意的就是分配方法.因为测试中涉及到ab两个版本,我们需要让ab两个版本随机显示给用户,但是又要做到比例对半分,也就是如果有10万个人来请求此页面,那么就要基本上是5万5万对半分.</span></p>
<p style="margin: 0px;"><span>abtest的示意图如下:</span></p>
<p style="text-align: center; margin: 0px;"><a href="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_48gqr4fbcm_b.png"><img class="alignnone size-full wp-image-627" title="dcv6jm5h_48gqr4fbcm_b" src="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_48gqr4fbcm_b.png" alt="dcv6jm5h_48gqr4fbcm_b" width="498" height="381" /></a></p>
<p style="text-align: center; margin: 0px;">
<p style="text-align: center; margin: 0px;">图 1 ABtest示意图</p>
<p style="margin: 0px;">
<p><span id="more-626"></span></p>
<p style="margin: 0px;"><span>abtest的最终目的是为了统计两个版本的转化率,有效链接点击次数,访问量,点击位置等信息.这些信息可以有不同的用途,例如:通过打点图(统计点击位置)可以看到用户更关注页面里的哪些地方,有的时候,很多用户的行为我们凭空想很难预料到,而通过打点图,我们可以清楚地看到用户的点击行为,下面是个打点图的例子:</span></p>
<p style="margin: 0px;">
<p style="text-align: center; margin: 0px;"><a href="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_494s4sppgg_b.png"><img class="alignnone size-full wp-image-628" title="dcv6jm5h_494s4sppgg_b" src="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_494s4sppgg_b.png" alt="dcv6jm5h_494s4sppgg_b" width="332" height="263" /></a></p>
<p style="text-align: center; margin: 0px;">
<p style="text-align: center; margin: 0px;"><span>图 2 热点图(之所以间隙那里点击率最高,是因为鼠标浮在手机通讯上的时候会出来一个弹出层,也可以看到用户对电器和手机比较关注)</span></p>
<p style="margin: 0px;">
<div id="u_00" style="margin-top: 0px; margin-bottom: 0px; text-align: left;">
<p style="text-align: center; margin: 0px;"><a href="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_50cj458kcj_b.png"><img class="alignnone size-full wp-image-629" title="dcv6jm5h_50cj458kcj_b" src="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_50cj458kcj_b.png" alt="dcv6jm5h_50cj458kcj_b" width="386" height="279" /></a></p>
<p style="text-align: center; margin: 0px;"><span><br />
</span></p>
<p style="text-align: center; margin: 0px;"><span>图 3 打点图(可以更直观看到点击率)</span></p>
<p style="margin: 0px;">
<h1 style="font-size: 18pt;"><span>三.系统支持.</span></h1>
<p><span style="font-size: x-small;"><br />
</span></p>
<p style="margin: 0px;"><span>之前,我没接触过abtest,所以不知道有什么好的系统,其实每个用研(用户研究)的团队内部都应该有这样一个系统,只是有的功能可能弱了点,表现不直观,要自己分析统计或者只能分析一些很简单的数据.今天发现google也提供了一个这样的类似工具,地址是:</span></p>
<p style="margin: 0px;"><a href="https://www.google.com/accounts/ServiceLogin?service=websiteoptimizer&amp;continue=https://www.google.com/analytics/siteopt/%3Fet%3Dreset%26hl%3Dzh-CN&amp;hl=zh-CN"></a><a href="https://www.google.com/accounts/ServiceLogin?service=websiteoptimizer&amp;continue=https://www.google.com/analytics/siteopt/%3Fet%3Dreset%26hl%3Dzh-CN&amp;hl=zh-CN"><span style="font-size: x-small;">https://www.google.com/accounts/ServiceLogin?service=websiteoptimizer&amp;continue=https://www.google.com/analytics/siteopt/%3Fet%3Dreset%26hl%3Dzh-CN&amp;hl=zh-CN</span></a></p>
</div>
<p style="margin: 0px;"><span>这个工具是免费的,对流量的支持应该也比较大,但是统计的数据比较少,而且我刚才试了一下,没有成功搭建.不知道什么情况</span></p>
<p style="margin: 0px;">
<p style="margin: 0px;"><span>阿里巴巴的这套系统,主要是提供了一个清晰而且强大的界面和数据呈现方式.让分析人员可以直观看到各种数据.鉴于此平台属于内部使用,所以暂时不能在此透露地址和具体形式等内容.</span></p>
<h1 style="font-size: 18pt;"><span>四.测试哪些东西.</span></h1>
<p><span style="font-size: x-small;"><br />
</span></p>
<p style="margin: 0px;"><span>都哪些场景可能要用到abtest呢?下面是一些应用场景:</span></p>
<ul style="margin-top: 0px; margin-bottom: 0px; border-color: initial; border-style: initial; color: #4d4d4d; list-style-type: none; margin-left: 0.5em; margin-right: 0px;">
<li style="border-color: initial; border-style: initial; list-style-type: disc; margin: 0px;">
<p style="margin: 0px;"><span>行动按钮的措辞，大小，颜色和位置，有的时候，改变一个重要按钮的颜色，就可以让成交率剧增。</span></p>
</li>
<li style="border-color: initial; border-style: initial; list-style-type: disc; margin: 0px;">
<p style="margin: 0px;"><span>标题或产品说明，有的时候，产品说明或许是对用户的干扰，有的时候，它却是必须的。</span></p>
</li>
<li style="border-color: initial; border-style: initial; list-style-type: disc; margin: 0px;">
<p style="margin: 0px;"><span>表单的数量和字段类型，表单过多会让用户放弃注册，但是有时候也会带来一种信任感。</span></p>
</li>
<li style="border-color: initial; border-style: initial; list-style-type: disc; margin: 0px;">
<p style="margin: 0px;"><span>网站的布局和风格，网站的改版是否成功呢。</span></p>
</li>
<li style="border-color: initial; border-style: initial; list-style-type: disc; margin: 0px;">
<p style="margin: 0px;"><span>产品定价和促销活动，何种产品定价对用户的吸引力更高呢。</span></p>
</li>
<li style="border-color: initial; border-style: initial; list-style-type: disc; margin: 0px;">
<p style="margin: 0px;"><span>着陆和产品页面上的图片，图片是造成了干扰还是必要的描述。</span></p>
</li>
<li style="border-color: initial; border-style: initial; list-style-type: disc; margin: 0px;">
<p style="margin: 0px;"><span>页面上文字的长度（少Vs多）。</span></p>
</li>
</ul>
<p style="margin: 0px;">
<p style="margin: 0px;"><strong>五.开始搭建.</strong></p>
<p style="margin: 0px;"><strong><br />
</strong></p>
<p style="margin: 0px;">下面就开始搭建一个abtest测试系统,就以我和阿里巴巴同事的问答形式来说明搭建一个系统需要哪些工作.</p>
<p style="margin: 0px;">1。准备工作.</p>
<p style="margin: 0px;">abtest首先需要准备两个页面,这个是毋庸置疑的.本次我们的处理对象是电器城首页,本次商城首页改版的时候,用研团队对是否保留商品图片下方的商品简介文字产生了争议,如下图所示:</p>
<p style="margin: 0px;">
<div id="q0ou" style="margin-top: 0px; margin-bottom: 0px; text-align: center;"><a href="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_51hdwqjqhp_b.png"><img class="alignnone size-full wp-image-630" title="dcv6jm5h_51hdwqjqhp_b" src="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_51hdwqjqhp_b.png" alt="dcv6jm5h_51hdwqjqhp_b" width="148" height="217" /></a></div>
<div id="q0ou" style="margin-top: 0px; margin-bottom: 0px; text-align: center;">图 4 需要研究的对象</div>
<div id="q0ou" style="margin-top: 0px; margin-bottom: 0px; text-align: left;">这个信息可以告诉用户一些有用的信息,和刺激性的信息,但是同时也可能会让用户没有方向感,在这些文字上感到迷惑,从而犹豫,最后放弃进入购买.</div>
<div id="q0ou" style="margin-top: 0px; margin-bottom: 0px; text-align: left;">于是,用研团队决定做个abtest,也就是做两个页面,然后将他们分别展示给不同的用户,然后统计何种情况下的链接有效点击率比较高.</div>
<div id="q0ou" style="margin-top: 0px; margin-bottom: 0px; text-align: left;">2。两种方法.</div>
<div id="q0ou" style="margin-top: 0px; margin-bottom: 0px; text-align: left;">abtest的核心就是分流,也就是平均分解流量.分流的方法大概可以分为两种,一种是前端分流,一种是后台分流,下图清晰地表达了这两种方式的区别:</div>
<div id="q0ou" style="margin-top: 0px; margin-bottom: 0px; text-align: left;">
<div id="dhzo" style="margin-top: 0px; margin-bottom: 0px; text-align: center;"><a href="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_52c5dg9vgw_b.png"><img class="alignnone size-full wp-image-631" title="dcv6jm5h_52c5dg9vgw_b" src="http://www.html-js.com/wp-content/uploads/2010/07/dcv6jm5h_52c5dg9vgw_b.png" alt="dcv6jm5h_52c5dg9vgw_b" width="472" height="368" /></a></div>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: center;">图 5 两种分流方式</div>
</div>
<p style="margin: 0px;">
<p style="margin: 0px;">
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;">back-end AB test的分流是由后台控制的,利用后台给不同的用户输出不同的页面,然后再页面里统计点击位置和数量.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">而Front-end AB test的分流则是由前台控制的.</li>
</ul>
<div style="margin-top: 0px; margin-bottom: 0px;">每种方式都有其优缺点,拿前端实现来说,前端分流可以节省时间,因为无需和后台配合,但是如何控制两个版本的分流?如果是在后台分流,将不用的用户定向到不同的链接即可,但是在前台来说,重定向会引起页面跳转,这样是不符合用户体验的.后台分流需要和前台配合,中间会多出一些没必要的沟通和交流成本,这里我们选用前端分流,下面会试图解决前端分流所带来的问题.</div>
<div style="margin-top: 0px; margin-bottom: 0px;">这样第一个问题就来了.</div>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;">
<table id="u6gv" style="font-size: 1em; line-height: inherit; border-collapse: collapse; text-align: left;" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#f3f3f3" bordercolor="#6fa8dc">
<tbody>
<tr style="text-align: left;">
<td style="text-align: left;" width="100%">Q:  如何分流?</td>
</tr>
<tr style="text-align: left;">
<td style="text-align: left;" width="100%">A:</p>
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;">在开通某次测试的时候先要跟阿里巴巴的接口人同事沟通好,他们需要确认你的测试是他们的服务器可以承受的,最后你需要给予他们两个url,一个是a版本的url,一个是b版本的url.最后这两个版本的url会显示在测试结果界面上.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">在前端处理分流的时候,通常用cookie里的用户标识来进行用户分流,在这次测试中,我使用了cookie中的t参数,这是一个16位数的用户标识,我根据最后一位的大小来判断呈现的版本.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">在选用cookie的时候需要多加注意,例如,我本次的需求,我选择cookie的标准是:首先要是每个用户唯一的;然后是没有登录的用户也会有的;再就是每个用户在一个浏览器中的cookie值都是不变的,这样我可以保证每个用户不管如何刷新或者登录未登录状态看到的页面都是某个特定版本的;还有就是具有足够的随机性,可以平均分流用户.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">前端分流,实际上,用户看到的都是同一个url,访问的也都是同一个页面,只是我们在页面呈现之前对页面做了一些处理.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">选择了cookie之后,下面就需要确定如何来让不同的用户看到不同的版本?</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<hr />
<table id="n7oi" style="font-size: 1em; line-height: inherit; border-collapse: collapse; text-align: left;" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#f3f3f3" bordercolor="#6fa8dc">
<tbody>
<tr style="text-align: left;">
<td width="100%">Q:  如何来让不同的用户看到不同的版本?</td>
</tr>
<tr style="text-align: left;">
<td width="100%">
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;">重定向用户到b版本页面</li>
</ul>
<div style="margin-top: 0px; margin-bottom: 0px;">将部分用户重定向到b版本的页面,但是这个需要后台来完成判断和跳转,因为如果是前台来设定跳转,会多余滴加载一个判断跳转的页面,而且可能会出现页面闪烁,对于前端分流来说,这都是不现实的.</div>
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;">在页面呈现前替换页面元素或样式</li>
</ul>
<div style="margin-top: 0px; margin-bottom: 0px;">这里有几个问题需要解决:</div>
<div style="margin-top: 0px; margin-bottom: 0px;">1.最重要的,要在页面被呈现之前将页面分流,也就是判断一定要很靠前,然后在判断好用户要看到的版本之后,立即对页面做处理,让用户看到的是自己版本的页面,这些工作都需要在页面呈现之前完成</div>
<div style="margin-top: 0px; margin-bottom: 0px;">2.虽然两种用户看到的是同一个页面,同一个页面,但是你需要实现一个程序,让用户用不同的url访问的时候不论用户是谁都显示特定版本的页面,例如:</div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: verdana, 宋体;"><span style="font-size: x-small;"><a style="color: #85ab34; text-decoration: none;" title="http://3c.taobao.com/?showabtestid=a" href="http://3c.taobao.com/?showabtestid=a" target="_blank">http://3c.taobao.com/?showabtestid=a</a> 和             <span style="font-family: verdana, 宋体;"><span style="font-size: x-small;"><span style="text-decoration: underline;"><a style="color: #c5d848;" title="http://3c.taobao.com/?showabtestid=b" href="http://3c.taobao.com/?showabtestid=b" target="_blank">http://3c.taobao.com/?showabtestid=b</a> </span></span></span></span></span></div>
<p>你访问这两个url,看到的分别是a版本和b版本,而不管你的cookie里的t参数是什么.后面会提到如何在程序中实现这些<br />
下面就是如何来实现呈现前替换页面内容和强制实现ab版本的访问.</td>
</tr>
</tbody>
</table>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;">先看一段代码,这段代码需要放在很靠前的位置</div>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;">
<div style="margin-top: 0px; margin-bottom: 0px; font-size: 12px;">
<table id="f3nc" style="font-size: 1em; line-height: inherit; border-collapse: collapse; height: 100%;" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#fff2cc" bordercolor="#9fc5e8">
<tbody>
<tr style="text-align: left;">
<td width="100%">
<div style="margin-top: 0px; margin-bottom: 0px;"><span>&lt;script&gt;</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> (function(){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> //指定显示给当前用户的是a版本还是b版本,false是a版本,true是b版本</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> YAHOO.abtest_7_8=false;</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> /*</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> *获取URI中的参数</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> */</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> var getParam=function(paras){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> var url = location.href,i,j;</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> var paraString = url.substring(url.indexOf(&#8220;?&#8221;)+1,url.length).split(&#8220;&amp;&#8221;);</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> var paraObj = {};</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> for (i=0; j=paraString[i]; i++){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> paraObj[j.substring(0,j.indexOf("=")).toLowerCase()] = j.substring(j.indexOf(&#8220;=&#8221;)+1,j.length);</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> var returnValue = paraObj[paras.toLowerCase()];</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> if(typeof(returnValue)==&#8221;undefined&#8221;){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> return &#8220;&#8221;;</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }else{</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> return returnValue;</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> },</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> /*</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> *给b版本设置不同的样式</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> */</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> setStyle=function(){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> YAHOO.abtest_7_8=true;</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> document.write(&#8220;&lt;style&gt;.good-info,.good-info2,  .sug-goods .info2, .sug-goods .info1{visibility: hidden;}&lt;/style&gt;&#8221;);</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> //根据URI里的showabtestid参数来确定显示哪个版本,虽然对于用户来说这里是没有意义的,</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> //但是对于alibaba这个abtest系统来说他们需要两个可以直观看到不同结果的URL</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> if(getParam(&#8220;showabtestid&#8221;)==&#8221;b&#8221;){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> setStyle();</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }else if(getParam(&#8220;showabtestid&#8221;)==&#8221;a&#8221;){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> YAHOO.abtest_7_8=false</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }else{</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> try{</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> //取cookie里的t参数的值,这个值是一大串16位表示的,取最后一位来判断给当前用户显示哪个版本的页面</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> var C=YAHOO.util.Cookie,</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> t=C.get(&#8220;t&#8221;),</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> t=t.charAt(t.length-1);</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> if(t&gt;&#8221;7&#8243;){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }else if(t&lt;=&#8221;7&#8243;){</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> setStyle();</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }catch(e){}</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> }</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> })()</span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span> &lt;/script&gt;</span></div>
<p><span style="font-size: small;"> </span></td>
</tr>
</tbody>
</table>
</div>
<p><span style="font-size: x-small;">上面这段代码做了这样几件事情:</span></p>
</div>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;">
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;">一个全局的标识,用来表示当前页面时a版本还是b版本,这个标识在下面的脚本中都会用到.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">定义了一个函数,这个函数可以在页面里写入一些样式,从而改变页面的最终呈现样式,这里我使用了document.write,我很担心这样写是不是会引起问题,但是的确是可以执行的,而且在页面呈现之前,样式已经被改变了.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">判断url里是否有<span>showabtestid参数,如果没有的话,就开始分流算法,取cookie,根据t的最后一位的大小来判断是否调用改变样式的函数.</span></li>
<li style="margin-top: 0px; margin-bottom: 0px;"><span>如果url里有<span>showabtestid参数,而且<span>showabtestid等于a,那么就强制显示a版本的页面样式,如果等于b,就强制显示b版本的页面样式.</span></span></span></li>
</ul>
<div style="margin-top: 0px; margin-bottom: 0px;"><span>至此,分流工作就完成了,可以看到,其实我们并没有将用户分流到不同的页面,而只是根据用户标识对页面的样式做了部分变化,让页面的呈现有所不同.</span></div>
</div>
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">接下来,我们需要开始了解abtest系统的工作机制了,事实上,机制很简单.</p>
<table id="qbs8" style="font-size: 1em; line-height: inherit; border-collapse: collapse; text-align: left;" border="1" cellspacing="0" cellpadding="3" width="100%" bgcolor="#f3f3f3" bordercolor="#6fa8dc">
<tbody>
<tr style="text-align: left;">
<td width="100%">Q:  alibaba abtest工作机制</td>
</tr>
<tr style="text-align: left;">
<td width="100%">A: <span><br />
</span></p>
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;"><span>此系统对于前端来说,只是需要几个数据,然后用ajax将这些数据传给阿里巴巴的后台服务器即可.</span></li>
<li style="margin-top: 0px; margin-bottom: 0px;"><span>需要的数据如下:(区分大小写)</span></li>
</ul>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span>abid</span></strong><span>: A/B Testing ID，格式为“AB测试ID/版本标识”，如 201006-1/a 201006-1/b </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickBlockX</span></strong><span>: 测试区块相对于页面左上角的 left 值，单位为像素 </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickBlockY</span></strong><span>: 测试区块相对于页面左上角的 top 值，单位为像素 </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickBlockW</span></strong><span>: 测试区块的宽度 </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickBlockH</span></strong><span>: 测试区块的高度</span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickTime</span></strong><span>: 点击时间戳，如 1263264082137 </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickRX</span></strong><span>: 点击相对于测试区块左上角的 left 值，单位为像素 </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickRY</span></strong><span>: 点击相对于测试区块左上角的 top 值，单位为像素</span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickURL</span></strong><span>: 当前点中的URL，如果点在空白处此项为空 </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> clickBeaconID</span></strong><span>: 用户Cookie标识，如 172.22.19.250.1256119417781.9 </span></span></div>
<div style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: 'courier new';"><strong><span> browserType</span></strong><span>: 用户浏览器，如：FireFox / IE6.0 / IE7.0 / IE8.0，除了IE外，其它浏览器不跟版本号</span></span></div>
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;"><span>打点服务器的地址:***,涉及保密信息,请联系我(天祁)或者阿里巴巴接口人.</span></li>
<li style="margin-top: 0px; margin-bottom: 0px;"><span>然后我们可以通过类似下面的方式组合一个请求:</span></li>
</ul>
<div style="margin-top: 0px; margin-bottom: 0px;">
<p><a style="background-color: transparent; color: #005577; margin-right: 2px; text-decoration: none; background-repeat: no-repeat no-repeat;" title="http://abtest.china.alibaba.com/abtest.html" rel="nofollow" href="http://abtest.china.alibaba.com/abtest.html"></a></p>
<p style="margin: 0px;"><span style="font-family: sans-serif;"><span style="text-decoration: underline;"><span style="word-break: break-all;">http://****/abtest.html?abid=1-a&amp;clickBlockX=244&amp;clickBlockY=372&amp;clickBlockW=392&amp;clickBlockH=76&amp;clickTime=1263264082137&amp;clickRX=233&amp;clickRY=47&amp;clickURL=&amp;clickBeaconID=172.22.19.250.1256119417781.9&amp;browserType=FireFox</span></span></span></p>
<p><span> 这里有几个需要注意的问题:</span></p>
</div>
<ul style="margin-top: 0px; margin-bottom: 0px;">
<li style="margin-top: 0px; margin-bottom: 0px;"><span>跨域问题:因为服务器是alibaba子域名下的,所以我们在淘宝的页面上做测试的时候如果用ajax请求,是会被拒绝的,所以这里需要考虑其他请求方式,也就是类似jsonp的概念,我的方法是创建了一个img元素,然后每次请求的时候,就是给img改变一次src,这样请求就可以成功发出了.</span></li>
<li style="margin-top: 0px; margin-bottom: 0px;">参数中的abid是指本次测试的id,每次测试都有一个不同的id,可以用日期命名,当你用一个新的id请求此url的时候,系统会自动为你的id生成一个测试项目,所以,不要随便设定id,也不要轻易去请求服务器,否则生成大量无用的测试项目,占用过多资源.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">abid中的斜杠后面的字母代表着版本,也就是当后面是a的时候,这次请求的数据就会被记录到a版本的数据中,后面是b,就记录到b版本的数据中.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">其他参数的注意事项:clickBlock系列参数指定的是要测试的方块的位置和大小,这个位置是相对于页面左上角的,如果页面是居中的,而且两边有空白的,那就按照有内容的部分的左上角开始算起,而不是整个窗口的左上角.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">clickTime是指本次点击的时间,1970.1.1到现在的毫秒数.clickR是指鼠标点击相对于测试区块的坐标,注意,而不是相对整个页面的坐标.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">clickURL是指是否点在了链接上,如果点在了链接上,就把链接编码后赋值给clickURL,否则就留空,这样可以统计有效点击率.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">clickBeaconID是指cookie标识,用t的值来表示即可,没有太硬性的要求.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">browserType:在这里要注意,因为后台是将Firefox最为标准浏览器来对待的,所以只有第一次用Firefox访问此页面的时候,服务器才会开始收集信息,开始定时截图.</li>
</ul>
<p><span><br />
</span></td>
</tr>
</tbody>
</table>
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">接下来,就是实现收集点击位置,然后传送数据的具体实现了,代码太长,就不贴出了,可以去电器城首页,看源代码的实现:<a href="http://3c.taobao.com/">http://3c.taobao.com/</a></p>
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">这段代码做了如下的事情:</p>
<p style="text-align: left; margin: 0px;">
<ul style="margin-top: 0px; margin-bottom: 0px; text-align: left;">
<li style="margin-top: 0px; margin-bottom: 0px;">手动定义要测试的区块(也就是一个div),和它的偏移位置和大小,</li>
<li style="margin-top: 0px; margin-bottom: 0px;">确定当前的版本是a还是b,收集必要信息,例如浏览器类型,用户标识</li>
<li style="margin-top: 0px; margin-bottom: 0px;">给区块绑定点击事件,当鼠标点击的时候,统计鼠标位置,时间信息,并判断是否点在了链接上,这里注意,有的图片外面套链接的情况需要一起考虑到.</li>
<li style="margin-top: 0px; margin-bottom: 0px;">点击事件里采集完数据后,就发送一个请求,这样后台就会多出一条记录.</li>
</ul>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;">其实,我们前端的工作到了此时就已经完成了,接下来过不了多久,结果页面上就可以看到统计结果了.</div>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;"><strong>六.总结</strong></div>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;">abtest其实说简单不简单,说难也不难,如果在使用的时候发现问题,可以联系我或者联系阿里巴巴的接口人:吴英杰-oldj</div>
<div style="margin-top: 0px; margin-bottom: 0px; text-align: left;">一些内部资料,例如wiki和项目列表,我没有在此列出,有需要的同事可以联系我索要.</div>
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">关于前端的实现方法,大家可以参考现在的电器城首页,如果测试完了,可能代码就被撤下了来了,这时候可以看我的demo页面的源代码:<a href="http://demo.ued.taobao.net/$tianqi/abtest/dianqicheng-a.html">http://demo.ued.taobao.net/$tianqi/abtest/dianqicheng-a.html</a></p>
<p style="text-align: left; margin: 0px;">谢谢大家.</p>
<p style="text-align: left; margin: 0px;"><strong>七.一些其他的零碎的问题</strong></p>
<p style="text-align: left; margin: 0px;">
<ul style="margin-top: 0px; margin-bottom: 0px; text-align: left;">
<li style="margin-top: 0px; margin-bottom: 0px;">有效点击的打点图中大部分都是打在了链接上,但是有的没有打在链接上,事实上这并不是程序错误,而是因为用户浏览器差异,所以造成部分统计偏差.</li>
</ul>
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">
<p style="text-align: left; margin: 0px;">
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=626</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>用一段ruby脚本把excel自动导出成table结构</title>
		<link>http://www.html-js.com/?p=625</link>
		<comments>http://www.html-js.com/?p=625#comments</comments>
		<pubDate>Mon, 12 Jul 2010 09:44:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[我的日记]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=625</guid>
		<description><![CDATA[require 'win32ole' $col_map =[&#34;&#34;,&#34;A&#34;,&#34;B&#34;,&#34;C&#34;,&#34;D&#34;,&#34;E&#34;,&#34;F&#34;,&#34;G&#34;,&#34;H&#34;,&#34;I&#34;,&#34;J&#34;,&#34;K&#34;,&#34;L&#34;,&#34;M&#34;,&#34;N&#34;,&#34;O&#34;,&#34;P&#34;,&#34;Q&#34;,&#34;R&#3... ]]></description>
			<content:encoded><![CDATA[<pre>require 'win32ole'
$col_map =[&quot;<span style="color: #8b0000"></span>&quot;,&quot;<span style="color: #8b0000">A</span>&quot;,&quot;<span style="color: #8b0000">B</span>&quot;,&quot;<span style="color: #8b0000">C</span>&quot;,&quot;<span style="color: #8b0000">D</span>&quot;,&quot;<span style="color: #8b0000">E</span>&quot;,&quot;<span style="color: #8b0000">F</span>&quot;,&quot;<span style="color: #8b0000">G</span>&quot;,&quot;<span style="color: #8b0000">H</span>&quot;,&quot;<span style="color: #8b0000">I</span>&quot;,&quot;<span style="color: #8b0000">J</span>&quot;,&quot;<span style="color: #8b0000">K</span>&quot;,&quot;<span style="color: #8b0000">L</span>&quot;,&quot;<span style="color: #8b0000">M</span>&quot;,&quot;<span style="color: #8b0000">N</span>&quot;,&quot;<span style="color: #8b0000">O</span>&quot;,&quot;<span style="color: #8b0000">P</span>&quot;,&quot;<span style="color: #8b0000">Q</span>&quot;,&quot;<span style="color: #8b0000">R</span>&quot;,&quot;<span style="color: #8b0000">S</span>&quot;,&quot;<span style="color: #8b0000">T</span>&quot;,&quot;<span style="color: #8b0000">U</span>&quot;,&quot;<span style="color: #8b0000">V</span>&quot;,&quot;<span style="color: #8b0000">W</span>&quot;,&quot;<span style="color: #8b0000">X</span>&quot;,&quot;<span style="color: #8b0000">Y</span>&quot;,&quot;<span style="color: #8b0000">Z</span>&quot;]
<span style="color: #0000ff">class</span> Excel_Info
  attr_accessor :file_name
  attr_accessor :range
  def initialize(file_name)
    @file_name = file_name
    @range = {}
  end
end
<span id="more-625"></span>
def load_data(filename)
  obj = nil
  File.open(filename, &quot;<span style="color: #8b0000">rb</span>&quot;) {|f| obj = Marshal.load(f)}
  <span style="color: #0000ff">return</span> obj
end

def save_data(obj, filename)
  File.open(filename, &quot;<span style="color: #8b0000">wb</span>&quot;) {|f| Marshal.dump(obj, f)}
end

def get_range_name(row, col)
  <span style="color: #0000ff">return</span> &quot;<span style="color: #8b0000">ERR</span>&quot; <span style="color: #0000ff">if</span> (col &lt; 1) || (row &lt; 1) || (col &gt; 26 * 27) || (row &gt; 65536)
  c2 = col % 26
  c2 = 26 <span style="color: #0000ff">if</span> c2 == 0
  c1 = (col - c2) / 26
  <span style="color: #0000ff">return</span> $col_map[c2] + row.to_s <span style="color: #0000ff">if</span> c1 == 0
  <span style="color: #0000ff">return</span> $col_map[c1] + $col_map[c2] + row.to_s
end

def read_excel(e_name, s_name)
  $excel.WorkBooks.Open(e_name)
  $excel.WorkSheets(s_name).Activate
  $excel_info = Excel_Info.<span style="color: #0000ff">new</span>(e_name)
  rows = $max_rows
  cols = $max_cols
  rows = $excel.WorkSheets(s_name).UsedRange.Rows.Count <span style="color: #0000ff">if</span> rows == 0
  <span style="color: #0000ff">for</span> row <span style="color: #0000ff">in</span> 1..rows
    <span style="color: #0000ff">for</span> col <span style="color: #0000ff">in</span> 1..cols
      $excel_info.range[get_range_name(row, col)] = $excel.Cells(row, col).<span style="color: #0000ff">value</span>.to_s
    end
  end

  $excel.WorkBooks.Close()
end

$MY_LOCATION = Dir.getwd
$excel = WIN32OLE.<span style="color: #0000ff">new</span>(&quot;<span style="color: #8b0000">excel.application</span>&quot;)
$excel.Visible = <span style="color: #0000ff">false</span>
$max_cols = 9
$max_rows =43
read_excel(&quot;<span style="color: #8b0000">C:\\Documents and Settings\\tianqi.sxy\\My Documents\\NetBeansProjects\\excel\\lib\\cookie.xls</span>&quot;,&quot;<span style="color: #8b0000">可以移到服务器端且不影响交易的cookie</span>&quot;)
save_data($excel_info, &quot;<span style="color: #8b0000">excel_info.obj</span>&quot;)
info = load_data(&quot;<span style="color: #8b0000">excel_info.obj</span>&quot;)

range=&quot;<span style="color: #8b0000">ACDEGHI</span>&quot; #在此指明要提取哪几列
startindex=4  #在此指明从第几行开始提取
headindex=3 #在此指明用第几行做表头
resultstr=&quot;<span style="color: #8b0000">&lt;table class=\&quot;cookie\&quot;&gt;</span>&quot;
resultstr+=&quot;<span style="color: #8b0000">&lt;tr&gt;</span>&quot;
<span style="color: #0000ff">for</span> colsss  <span style="color: #0000ff">in</span> 0..$max_cols-3

  resultstr+=&quot;<span style="color: #8b0000">&lt;th&gt;</span>&quot;+info.range[range[colsss,1]+headindex.to_s].to_s+&quot;<span style="color: #8b0000">&lt;/th&gt;</span>&quot;
end
resultstr+=&quot;<span style="color: #8b0000">&lt;/tr&gt;</span>&quot;
<span style="color: #0000ff">for</span> rowss <span style="color: #0000ff">in</span> startindex..$max_rows
  resultstr+=&quot;<span style="color: #8b0000">&lt;tr&gt;</span>&quot;

  <span style="color: #0000ff">for</span> colss <span style="color: #0000ff">in</span> 0..$max_cols-3
    resultstr=resultstr+&quot;<span style="color: #8b0000">&lt;td&gt;</span>&quot;+info.range[range[colss,1]+rowss.to_s].to_s+&quot;<span style="color: #8b0000">&lt;/td&gt;</span>&quot;

  end
  resultstr+=&quot;<span style="color: #8b0000">&lt;/tr&gt;</span>&quot;
end
resultstr+=&quot;<span style="color: #8b0000">&lt;/table&gt;</span>&quot;
#puts resultstr
$excel.Quit()
#写入文件
f = open(&quot;<span style="color: #8b0000">C:\\Documents and Settings\\tianqi.sxy\\My Documents\\NetBeansProjects\\excel\\lib\\index.js</span>&quot;,&quot;<span style="color: #8b0000">a</span>&quot;)
f.puts resultstr</pre>
<p>没有说明,就是这么用&#8230;.自己琢磨吧</p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=625</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我参加的一次公益活动，希望大家给贫困儿童捐点书，一起帮忙分享转播一下，谢谢</title>
		<link>http://www.html-js.com/?p=621</link>
		<comments>http://www.html-js.com/?p=621#comments</comments>
		<pubDate>Sun, 11 Jul 2010 09:15:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[生活琐事]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=621</guid>
		<description><![CDATA[这次活动是我们淘宝网校园招聘百年大学培训第五期的全班同学共同发起的公益活动，我们在贫困地区为贫困儿童建立了一座图书馆，然后我们组织淘宝网卖家和社会的力量来为贫困儿童捐书... ]]></description>
			<content:encoded><![CDATA[<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left">这次活动是我们淘宝网校园招聘百年大学培训第五期的全班同学共同发起的公益活动，我们在贫困地区为贫困儿童建立了一座图书馆，然后我们组织淘宝网卖家和社会的力量来为贫困儿童捐书，公益，其实每个人都可以付出自己的一份力量，对你来说只是几本书，但是对那些孩子来说，他们得到的是希望和未来。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left">具体可以联系我，留言给我，也可以联系下面的人的联系方式，谢谢，请帮忙转载和分享。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><strong><span style="padding: 0px; margin: 0px;">1</span><span style="padding: 0px; margin: 0px;">个乡村图书馆</span></strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><strong><span style="padding: 0px; margin: 0px;">1</span><span style="padding: 0px; margin: 0px;">个乡村的梦想</span></strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;"><strong>实现它需要</strong></span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><strong><span style="padding: 0px; margin: 0px;">1</span><span style="padding: 0px; margin: 0px;">个人捐</span><span style="padding: 0px; margin: 0px;">5000</span><span style="padding: 0px; margin: 0px;">本书</span></strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><strong><span style="padding: 0px; margin: 0px;">10</span><span style="padding: 0px; margin: 0px;">个人每人捐</span><span style="padding: 0px; margin: 0px;">500</span><span style="padding: 0px; margin: 0px;">本书</span></strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><strong><span style="padding: 0px; margin: 0px;">100</span><span style="padding: 0px; margin: 0px;">个人每人捐</span><span style="padding: 0px; margin: 0px;">50</span><span style="padding: 0px; margin: 0px;">本书</span></strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><strong><span style="padding: 0px; margin: 0px;">1000</span><span style="padding: 0px; margin: 0px;">个人每人捐</span><span style="padding: 0px; margin: 0px;">5</span><span style="padding: 0px; margin: 0px;">本书</span></strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;" align="left"><span style="padding: 0px; margin: 0px;"><strong><span style="padding: 0px; margin: 0px;">还犹豫什么，让我们成为这</span><span style="padding: 0px; margin: 0px;">1000</span><span style="padding: 0px; margin: 0px;">分之一</span></strong></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"> </span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><strong> 所需书籍：</strong> 适合青少年，山村教师，村民阅读的书籍</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><strong>书籍去向：</strong>四川省合江县茅山小学茅山乡村图书馆</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><strong>邮寄地址：</strong></span><span style="padding: 0px; margin: 0px;">四川省泸州市纳溪区东门口西南化工研究院<span style="padding: 0px; margin: 0px;">34</span>幢<span style="padding: 0px; margin: 0px;">802</span>室 熊启华收</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;"> </span></span><span style="padding: 0px; margin: 0px;">邮编：<span style="padding: 0px; margin: 0px;">646300 </span>手机：<span style="padding: 0px; margin: 0px;">13937510823</span></span></p>
<p><span id="more-621"></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><strong>详情咨询：</strong> 旺旺：<span style="padding: 0px; margin: 0px;">luoxirocy<span style="padding: 0px; margin: 0px;"> </span><span style="padding: 0px; margin: 0px;"> </span>QQ</span>：<span style="padding: 0px; margin: 0px;">84614374</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><strong><span style="padding: 0px; margin: 0px;"> </span></strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><strong><span style="padding: 0px; margin: 0px;">捐助地介绍</span></strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;">茅山小学位于四川南部合江县凤鸣镇，距凤鸣镇政府<span style="padding: 0px; margin: 0px;">10</span>公里，现有小学教学班<span style="padding: 0px; margin: 0px;">9</span>个，幼儿学前班<span style="padding: 0px; margin: 0px;">3</span>个，有学生近<span style="padding: 0px; margin: 0px;">500</span>人。处于浅表性滑坡地带，<span style="padding: 0px; margin: 0px;">2003</span>年利用“逸夫基金”进行新迁建，因为资金严重不足，就只建设了学校最简单的教学设施。</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;">学生全部来自农村，<span style="padding: 0px; margin: 0px;"> 50%</span>的学生家距学校有<span style="padding: 0px; margin: 0px;">5</span>公里以上的路程，崎岖的山路上终年有孩子们起早贪黑，打着电筒上学和回家的身影。山村孩子除教科书外基本无书可读，精神食粮极其缺乏，非常渴望能得到社会各界的帮助。</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><img style="max-width: 550px; padding: 0px; margin: 0px;" src="http://img01.taobaocdn.com/sns_album/i1/T1wQtFXllDXXb1upjX.jpg" alt="" width="450" /></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;">大山中的学校&#8212;&#8211;茅山小学</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><img style="max-width: 550px; padding: 0px; margin: 0px;" src="http://img02.taobaocdn.com/sns_album/i2/T1EABFXnpAXXb1upjX.jpg" alt="" /></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;">在土的跑道上进行的运动会</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><img style="max-width: 550px; padding: 0px; margin: 0px;" src="http://img01.taobaocdn.com/sns_album/i1/T1v80FXiRaXXb1upjX.jpg" alt="" /></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;">破旧的教师公寓</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">捐一本书，成就一群孩子的梦想</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><strong><span style="padding: 0px; margin: 0px;"> 邮寄地址：</span><span style="padding: 0px; margin: 0px;">四川省泸州市纳溪区东门口西南化工研究院<span style="padding: 0px; margin: 0px;">34</span>幢<span style="padding: 0px; margin: 0px;">802</span>室 熊启华收</span></strong></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;"> </span></span><span style="padding: 0px; margin: 0px;">邮编：<span style="padding: 0px; margin: 0px;">646300 </span>手机：<span style="padding: 0px; margin: 0px;">13937510823</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="padding: 0px; margin: 0px;"><span style="padding: 0px; margin: 0px;"> 详情咨询：旺旺luoxirocy  QQ 84614374</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=621</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一个简单的js时钟，新加flash版</title>
		<link>http://www.html-js.com/?p=611</link>
		<comments>http://www.html-js.com/?p=611#comments</comments>
		<pubDate>Sun, 11 Jul 2010 00:37:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[时钟]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=611</guid>
		<description><![CDATA[昨天远图哥说是有这么个小需求,于是我就顺手做了一个,很简单的时钟,呵呵. 用到了这么一个图片: 这是最终效果,右击可以查看源代码 #J_TB_clock{ width:104px; height:30px; } #J_TB_clock_3{ width:10px; } .big-nu... ]]></description>
			<content:encoded><![CDATA[<p>昨天远图哥说是有这么个小需求,于是我就顺手做了一个,很简单的时钟,呵呵.<br />
用到了这么一个图片:</p>
<blockquote><p><a href="http://www.html-js.com/wp-content/uploads/2010/07/clock.png"><img class="alignnone size-full wp-image-612" title="clock" src="http://www.html-js.com/wp-content/uploads/2010/07/clock.png" alt="clock" width="210" height="45" /></a></p></blockquote>
<p>这是最终效果,右击可以查看源代码</p>
<div id="J_TB_clock">
<div id="J_TB_clock_1" class="big-num"></div>
<div id="J_TB_clock_2" class="big-num"></div>
<div id="J_TB_clock_3" class="big-num"></div>
<div id="J_TB_clock_4" class="big-num"></div>
<div id="J_TB_clock_5" class="big-num"></div>
<div id="J_TB_clock_6" class="small-num"></div>
<div id="J_TB_clock_7" class="small-num"></div>
</p>
</div>
<style> 
    #J_TB_clock{
        width:104px;
        height:30px;</p>
<p>    }
	#J_TB_clock_3{
	width:10px;
	}
    .big-num{
        float:left;
        width:16px;
        height:30px;
	margin-right:2px;
        background: url(http://www.html-js.com/wp-content/uploads/2010/07/clock.png) no-repeat;
    }
    .small-num{
        float:left;
        width:9px;
        height:15px;
        background: url(http://www.html-js.com/wp-content/uploads/2010/07/clock.png) no-repeat;
        margin-top:15px;
    }
    #J_TB_clock_6{
        margin-left: 2px;
    }
</style>
<p><script> 
    var TBClock=function(){
        var get=function(ele){
            return document.getElementById(ele)
        },
        fillZero=function(num,length){
            num=num.toString();
            length=length||2
            var str="";
            for(var i=0,n=length-num.length;i<n;i++){
                str+="0";
            }
            return str+num;
        },
        setPos=function(ele,value,y){
            ele.style.backgroundPosition="-"+value+"px "+y+"px";
        },
        setBigNum=function(ele,ele2,num){
            setPos(ele,num.charAt(0)*16.4,0)
            setPos(ele2,num.charAt(1)*16.4,0)
        },
        setFlashP=function(ele){
            ele.style.backgroundPosition=((TBClock.flash=!TBClock.flash)==true)?"-164px 0":"-180px 0";
        },
        setSmallNum=function(ele,ele2,num){
            setPos(ele,num.charAt(0)*10,-31)
            setPos(ele2,num.charAt(1)*10,-31)
        }
        var eles={
            h1:get("J_TB_clock_1"),
            h2:get("J_TB_clock_2"),
            m1:get("J_TB_clock_4"),
            m2:get("J_TB_clock_5"),
            s1:get("J_TB_clock_6"),
            s2:get("J_TB_clock_7"),
            p:get("J_TB_clock_3")
        }
        return {
            flash:true,
            init:function(){
                this.start();
            },
            start:function(){
			this.go();
                setInterval(this.go,1000)
            },
            go:function(){
                var T=new Date();
                setBigNum(eles.h1,eles.h2,fillZero(T.getHours()))
                setBigNum(eles.m1,eles.m2,fillZero(T.getMinutes()))
                setFlashP(eles.p)
                setSmallNum(eles.s1,eles.s2,fillZero(T.getSeconds()))
            }
        }
    }();
    TBClock.init();
</script></p>
<p>下面是一个用flash实现的同样的时钟：<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="30" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.html-js.com/wp-content/uploads/2010/07/clock1.swf" /><embed type="application/x-shockwave-flash" width="100" height="30" src="http://www.html-js.com/wp-content/uploads/2010/07/clock1.swf"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=611</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>淘宝无线招聘,有意向者email我</title>
		<link>http://www.html-js.com/?p=607</link>
		<comments>http://www.html-js.com/?p=607#comments</comments>
		<pubDate>Thu, 08 Jul 2010 00:49:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[生活琐事]]></category>
		<category><![CDATA[招聘]]></category>
		<category><![CDATA[无线]]></category>

		<guid isPermaLink="false">http://www.html-js.com/?p=607</guid>
		<description><![CDATA[中国8亿的手机用户最想做什么事？ 2010年淘宝8341计划中，一个最为神秘的部门你知道是哪个部门？ 马总认为在中国唯一有机会在电子商务领域超越淘宝的机会，你知道在哪里？ 来看这里吧！... ]]></description>
			<content:encoded><![CDATA[<p><span style="color: #333333; border-collapse: collapse; font-family: Arial; line-height: 24px;"><span style="line-height: 1.5em; font-size: medium;"><br style="font-size: 12px;" /></span></span><span style="line-height: 1.5em; font-size: medium;"><span style="color: #6633cc;"><strong><span style="line-height: 1.5em; font-family: 微软雅黑;">中国8亿的<span id="rlt_5" style="cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b;">手机</span>用户最想做什么事？<br />
</span><br />
<span style="line-height: 1.5em; font-family: 微软雅黑;">2010</span></strong></span></span><span style="line-height: 1.5em; font-size: medium;"><span style="color: #6633cc;"><strong><span style="line-height: 1.5em; font-family: 微软雅黑;">年淘宝8341计划中，一个最为神秘的部门你知道是哪个部门？<br />
</span><br />
</strong></span></span><span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;"><span style="color: #6633cc;"><strong><span id="rlt_8" style="cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b;">马总</span>认为在中国唯一有机会在电子商务领域超越<span id="rlt_1" style="cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b;">淘宝</span>的机会，你知道在哪里？</strong></span><br />
</span></span><span style="line-height: 1.5em; font-size: medium;"><br />
</span><span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;">来看这里吧！答案马上揭晓！ </span></span><span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;"><br />
</span><span id="more-607"></span><br />
</span><span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;">请用<span id="rlt_2" style="cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b;">旺旺</span>广告的分贝，大声跟我们念：<strong><span style="color: #ff0000;">淘宝无线！</span></strong><br />
</span><br />
</span><span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;">心跳加速了吗？想立即体验为8亿手机用户创造价值的<span id="rlt_7" style="cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b;">创业</span><span id="rlt_6" style="cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b;">团队</span>吗？<br />
</span><br />
<span style="line-height: 1.5em; font-family: 微软雅黑;">看，我们现诚聘以下岗位：</span><br />
</span><br />
<span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;">****************************************************************************</span><br />
</span><br />
<span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;">资深J2EE工程师/J2EE工程师/手机<span id="rlt_4" style="cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #fa891b;">客户</span>端架构师/手机客户端工程师/Hadoop开发工程师/类目运营专员/活动策划/产品经理/服装、数码、图书、饰品、运动行业网站编辑</span><br />
</span><br />
<span style="line-height: 1.5em; font-size: medium;"><span style="line-height: 1.5em; font-family: 微软雅黑;">****************************************************************************</span><br />
<span style="line-height: 1.5em; font-family: 微软雅黑;">如果你有着超越淘宝的激情，如果你想在快乐中体验创业的乐趣，那么无线事业部欢迎你推荐！</span> </span></p>
<h1><span style="line-height: 1.5em; font-size: medium;"><span style="color: #ff0000;">有意者email我:xinyu198736@gmail.com</span></span></h1>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">还有其他各种职位,包括:运营,pd,客服,产品,设计师,各种开发工程师(前端,java,c++,算法,c)架构师.技术支持,等等职位.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">即将大四的同学可以投简历来参加实习,来大公司实习是一笔难得的财富.而且基本都可以留在这里.有经验的同学请在邮件中注明:有经验.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">本次重点强调 <strong style="padding: 0px; margin: 0px;">淘</strong><span style="font-size: 14pt; padding: 0px; margin: 0px;"><strong style="padding: 0px; margin: 0px;">宝无线事业部</strong></span>的招聘,急招,无线事业部是淘宝将来会重点发展的部门,主要从事手机移动方面的研发营销等工作.</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">淘宝无线部门诚聘以下  职位：<br />
资深J2EE工程师/J2EE工程师/手机客户端架构师/手机客户端工程师/Hadoop开发工程师/类目运营专员/活动策划/产品经理/服装、数码、图书、饰品、运动行业网站编辑</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">热烈期待更多优秀人才加入淘宝，和淘宝一起成长<br />
我们的职位主要包括：JAVA、测试、PHP、搜索、C/C++方面的技术人才，以及各类产品、运营人才，还有财务、法务、内审、客户服务专员、消费者维权专员等职能类人才；</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;">
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="color: #ff0000; padding: 0px; margin: 0px;"><span style="font-size: 14pt; padding: 0px; margin: 0px;">其他部门也可投简历,投简历请直接投给我,我会内部推荐,机会大大的有.</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="color: #ff0000; padding: 0px; margin: 0px;"><span style="font-size: 14pt; padding: 0px; margin: 0px;">我的邮箱:xinyu198736@gmail.com</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="color: #ff0000; padding: 0px; margin: 0px;"><span style="font-size: 14pt; padding: 0px; margin: 0px;">qq:676588498</span></span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; padding: 0px;"><span style="color: #ff0000; padding: 0px; margin: 0px;"><span style="font-size: 14pt; padding: 0px; margin: 0px;">关于淘宝的文化,可以qq我,我给你讲,也可以看我的相册,淘宝是个非常自由的国度,是梦想的舞台,是个开放的平台.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.html-js.com/?feed=rss2&amp;p=607</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
