<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feed.11gz.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Heluyao's Blog</title>
	
	<link>http://11gz.com/blog</link>
	<description>设计、开发路上的点点滴滴...</description>
	<lastBuildDate>Fri, 05 Aug 2011 07:24:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	
<!-- Start Of Script Generated By WP-PostViews Plus -->
<script type="text/javascript" src="http://11gz.com/blog/wp-includes/js/jquery/jquery.js?ver=1.4.4" />
<script type="text/javascript">
/* <![CDATA[ */
/* ]]> */
</script>
<!-- End Of Script Generated By WP-PostViews Plus -->
	<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feed.11gz.com/Heluyao" /><feedburner:info uri="heluyao" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>设计、开发路上的点点滴滴...</itunes:subtitle><item>
		<title>写高质量的jQuery</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/JQHxv-kvOhs/</link>
		<comments>http://11gz.com/blog/2011/08/05/high-performance-jquery/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 07:22:50 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[JS/Ajax/AS]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=585</guid>
		<description><![CDATA[看了一篇关于jQuery性能提升的文章，十分认同，总结一下(原文一共是十点，我省略了一部分)：1.尽量只用id选择器和标签选择器，比如jQuery("#selector")、jQuery("TagName")，减少class选择器的使用，避... ]]></description>
			<content:encoded><![CDATA[<p>看了一篇关于jQuery性能提升的文章，十分认同，总结一下(原文一共是十点，我省略了一部分)：</p>
<p>1.尽量只用id选择器和标签选择器，比如jQuery(&#8220;#selector&#8221;)、jQuery(&#8220;TagName&#8221;)，减少class选择器的使用，避免伪类选择器和属性选择器。</p>
<p>2.查找子节点时推荐使用find，比如jQuery(&#8220;body&#8221;).find(&#8220;p&#8221;)。</p>
<p>3.利用delegate将事件委托，例如给一个长列表逐个绑定事件，就可以使用delegate。delegata方法请参看jQuery API。</p>
<p>4.尽量减少DOM结构的改动(如.append()、.insertBefore()和.insetAfter())，避免不了也要记得先合并再一次性插入，大范围的DOM结构改动，可以利用detach方法先取出，操作好之后再插入。detach方法请参看jQuery API。</p>
<p>5.循环，尽量使用js原生的for或while，减少使用jQuery的each方法。</p>
<p>原文比较详细的并以数据说明了造成性能问题的原因，有兴趣就马上<a href="http://www.ruanyifeng.com/blog/2011/08/jquery_best_practices.html">猛击</a>过去了解。</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/JQHxv-kvOhs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/08/05/high-performance-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/08/05/high-performance-jquery/</feedburner:origLink></item>
		<item>
		<title>笔记：网站性能优化—​—优化Sprite</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/NV_ZkU_Xm_E/</link>
		<comments>http://11gz.com/blog/2011/07/31/optimization-sprite/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 15:00:16 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[html/css/xml/xsl]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=581</guid>
		<description><![CDATA[1.按颜色合并，将颜色调色板相近的图标组合在一起。2.避免不必要的空白(通常我会留出1px的距离)。3.水平排列，而不是垂直。
... ]]></description>
			<content:encoded><![CDATA[<p>1.按颜色合并，将颜色调色板相近的图标组合在一起。<br />
2.避免不必要的空白(通常我会留出1px的距离)。<br />
3.水平排列，而不是垂直。<br />
4.将保存为png8格式。<br />
5.先优化一遍图像，再合并成sprite。<br />
6.通过控制大小和对齐减少反锯齿像素的数量。<br />
7.避免使用对角线渐变，无法被平铺。<br />
8.最好避免在ie6下中使用alpha透明图像，若一定要用就保存在单独的sprite中。<br />
9.使用马赛克式的渐变。<br />
10.要特别注意logo的质量。</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/NV_ZkU_Xm_E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/07/31/optimization-sprite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/07/31/optimization-sprite/</feedburner:origLink></item>
		<item>
		<title>笔记：网站性能优化——图像优化</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/DNUu33nKJHM/</link>
		<comments>http://11gz.com/blog/2011/07/30/optimization-image/#comments</comments>
		<pubDate>Sat, 30 Jul 2011 13:12:43 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[html/css/xml/xsl]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=580</guid>
		<description><![CDATA[优化PNG格式的图像 推荐工具：Pngcrush(http://pmt.sourceforge.net/pngcrush/) 其他工具：PNGOUT,OptiPNG,PngOptimizer 剥离JPEG的元数据 什么是 元数据？ 1.注释。 2.应用程序定义的内部信息（如photoshop）。 3.EXIF信... ]]></description>
			<content:encoded><![CDATA[<h3>优化PNG格式的图像</h3>
<p>推荐工具：Pngcrush(http://pmt.sourceforge.net/pngcrush/)</p>
<p>其他工具：PNGOUT,OptiPNG,PngOptimizer</p>
<h3>剥离JPEG的元数据</h3>
<p>什么是 元数据？</p>
<p>1.注释。</p>
<p>2.应用程序定义的内部信息（如photoshop）。</p>
<p>3.EXIF信息。</p>
<p>工具：jpegtran(http://jpegclub.org)</p>
<h3>将gif转换成png</h3>
<p>如果gif图像中不包含动画，那就转换到png。转换后还要记得用Pngcrush优化哦！</p>
<h3>优化GIF动画</h3>
<p>工具：Gifsicle(http://www.lcdf.org/gifsicle/)</p>
<h3>在线优化图像——Smush.it</h3>
<p>前面提到的事情它都能胜任，只是在JPEG上为了保留版权信息没有剥离元数据。</p>
<h3>使用渐进JPEG格式来储存大图像</h3>
<p>这个能让图像在浏览器中逐步进行渲染。要注意的是文件比较大时才考虑使用该方法。</p>
<h3>避免使用AlphaImageLoader</h3>
<p>增加了代码的维护成本，还会造成直接的性能损耗。替代方案是使用VML或者采用渐进增强思维。</p>
<h3>避免对图像进行缩放</h3>
<p>比如将一张400×400的图缩放至200×200。缺点是既降低了图片质量又增大了下载量。</p>
<h3>不要忘了favicons和Apple触摸图标</h3>
<p>让文件更小且被缓存。</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/DNUu33nKJHM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/07/30/optimization-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/07/30/optimization-image/</feedburner:origLink></item>
		<item>
		<title>睡不着</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/5DoDZ4FThFc/</link>
		<comments>http://11gz.com/blog/2011/07/29/insomnia/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 17:58:46 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[生活点滴]]></category>
		<category><![CDATA[闲聊]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=579</guid>
		<description><![CDATA[最近这小日子太舒坦了，几乎天天都在庆祝。今天刚好给博客装了个wap插件，现在手机也能更新博客了。晚上没事又睡不着就随便记录几句吧... ]]></description>
			<content:encoded><![CDATA[<p>最近这小日子太舒坦了，几乎天天都在庆祝。今天刚好给博客装了个wap插件，现在手机也能更新博客了。晚上没事又睡不着就随便记录几句吧！</p>
<p>2011挺顺的，工作和生活上都是。今天lp医院的产检结果很好，小baby很健康，三维bc让我第一次见到他（她）的样子，还挺漂亮的，lp说小家伙长得像极了我，哈哈！再等将近4个月他（她）就出生了，期待啊！</p>
<p>2011当然不会放慢学习的脚步啦！主要精力还是放在javascript,html5,css3上，将之前已读过的几本js方面的书又重读了一遍，加深印象以便更好的融会贯通，都有《JavaScript高级程序设计》、《深入浅出JavaScript 》、《JavaScript DOM编程艺术 》，还读了《html5高级程序设计》，基本了解了canvas、web storage、web sockets、web workers、geolocation、离线应用，目前正在读《高性能网站建设进阶指南》一书，在网站性能优化方面可谓是受益匪浅，未来的日子里准备拜读《JavaScript设计模式》和《高性能JavaScript》两本大作，最近还大致上了解了nodejs(在服务端跑的javascript)并系统的学习了淘宝玉伯的seajs(异步无阻塞和代码模块化)，js方面还是有一段很长的路要走的；至于css3，说到底就是增加了一些新的Selectors和特性(比如渐变色、圆角边框、阴影、多重背景图、透明度、css动画、css3D渲染&#8230;)，后端的一些技术也慢慢深入(php)，服务器方面的经验也有了一定积累；还有过一段时间的actionscript(as2)开发经历，独立开发了一个音乐播放器并实现了歌曲列表和lrc动态歌词的功能，升级了网站的视频播放器，添加了分享、颜色调整、尺寸大小调整等等。</p>
<p>其实总结起来也没什么，又要感叹“时间太瘦，指缝太宽”了！每天时间不够用啊，看来好好管理自己的时间是十分重要的！</p>
<p>抓紧时间睡觉了，要不明天上班又没精神了。听完这首我不知道名字但好听的歌…Zz  Zz……</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/5DoDZ4FThFc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/07/29/insomnia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/07/29/insomnia/</feedburner:origLink></item>
		<item>
		<title>minify优化网站</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/hvqIr-mE-ug/</link>
		<comments>http://11gz.com/blog/2011/07/05/minify-optimization-website/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 09:39:59 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[JS/Ajax/AS]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=578</guid>
		<description><![CDATA[项目地址：http://code.google.com/p/minify/。作用：合并(减少HTTP请求)、精简、Gzip压缩和缓存JavaScript和CSS文件。配置：Apache+PHP，开启Mod Rewrite... ]]></description>
			<content:encoded><![CDATA[<p>项目地址：<a href="http://code.google.com/p/minify/" title="http://code.google.com/p/minify/">minify</a></p>
<p>作用：合并(减少HTTP请求)、精简、Gzip压缩和缓存JavaScript和CSS文件。</p>
<p>配置：Apache+PHP，开启Mod Rewrite。</p>
<p>下载：<a href="http://minify.googlecode.com/files/minify_2.1.3.zip" title="http://minify.googlecode.com/files/minify_2.1.3.zip">minify_2.1.3.zip</a></p>
<p>安装：解压后将min文件夹复制到网站根目录。</p>
<p>使用：</p>
<div class="hl-surround"><div class="hl-main"><span style="color: Olive;">&lt;</span><span style="color: #660;">script</span><span style="color: Gray;"> </span><span style="color: #00008b;">src</span><span style="color: Gray;">=</span><span style="color: #080;">&quot;</span><span style="color: #066;">http://youDomain.com/min/f=/js/a.js,/js/b.js,/js/c.js</span><span style="color: #080;">&quot;</span><span style="color: Olive;">&gt;&lt;/</span><span style="color: #660;">script</span><span style="color: Olive;">&gt;</span></div></div>
<p>整个过程非常简单，只要你的服务器配置支持到位，基本就是傻瓜式的操作了。如果要配置得更加详细，比如缓存文件、控制是否压缩代码&#8230;等等，那么请参看<a href="http://code.google.com/p/minify/wiki/CookBook" title="http://code.google.com/p/minify/wiki/CookBook">Minify CookBook</a>和<a href="http://code.google.com/p/minify/w/list" title="http://code.google.com/p/minify/w/list">Wiki</a>，也可以看口碑网UED的文章<a href="http://ued.koubei.com/?p=1193#more-1193" title="http://ued.koubei.com/?p=1193#more-1193">在服务端合并和压缩JavaScript和CSS文件</a>。</p>
<p>效果预览：<a href="http://11gz.com/demo/js-ajax/minify/index.html" title="http://11gz.com/demo/js-ajax/minify/index.html">http://11gz.com/demo/js-ajax/minify/index.html</a>，请配合相关查看http请求记录的工具(HttpWatch/FireBug)浏览该代码。</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/hvqIr-mE-ug" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/07/05/minify-optimization-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/07/05/minify-optimization-website/</feedburner:origLink></item>
		<item>
		<title>blog的RSS托管服务换成feedburner</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/WPL-5OCIQeY/</link>
		<comments>http://11gz.com/blog/2011/07/04/blog-rss-feedburner/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 04:19:08 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[生活点滴]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=577</guid>
		<description><![CDATA[未知原因，feedsky的RSS托管服务不能正常使用，好几天前的事情了。今天将blog的订阅地址换成feedburner，还请有兴趣的朋友更新一下订阅地址！http://feed.11gz.com/heluyao。不得不感叹一下，feedburner的... ]]></description>
			<content:encoded><![CDATA[<p>未知原因，feedsky的RSS托管服务不能正常使用，好几天前的事情了。今天将blog的订阅地址换成feedburner，还请有兴趣的朋友更新一下订阅地址！</p>
<p style="font-weight:bold;"><a href="http://feed.11gz.com/heluyao">http://feed.11gz.com/heluyao</a></p>
<p>不得不感叹一下，feedburner的速度是严重快过feedsky，据说稳定性也超强！</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/WPL-5OCIQeY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/07/04/blog-rss-feedburner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/07/04/blog-rss-feedburner/</feedburner:origLink></item>
		<item>
		<title>上Google要这样</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/rjwdGJikD0s/</link>
		<comments>http://11gz.com/blog/2011/07/02/visit-google-host/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 08:47:43 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[纯属扯淡]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=574</guid>
		<description><![CDATA[如果你也离不开google reader、Gmail...等等，可以尝试以下方法，也许日后这样也不行了，那就默默祷告吧... ]]></description>
			<content:encoded><![CDATA[<p>如果你也离不开google reader、Gmail&#8230;等等，可以尝试以下方法，也许日后这样也不行了，那就默默祷告吧！</p>
<p>修改host文件，添加如下内容并保存。</p>
<p>203.208.39.22 webcache.googleusercontent.com<br />
203.208.39.22 mail.google.com<br />
203.208.39.22 www.google.com.hk<br />
203.208.39.22 www.google.com
</p>
<p>开始 > 运行 > 输入cmd > 继续输入ipconfig /flushdns > 关闭“命令提示符”，ok了！</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/rjwdGJikD0s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/07/02/visit-google-host/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/07/02/visit-google-host/</feedburner:origLink></item>
		<item>
		<title>记录一下：windows下配置node.js</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/xx-GXDBRHg8/</link>
		<comments>http://11gz.com/blog/2011/06/22/windows-nodejs-configuration/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 06:03:38 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[JS/Ajax/AS]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=572</guid>
		<description><![CDATA[现如今，node大热，不弄弄，那不落伍了！服务器端嘛，首先还是配置环境，第一步走出去了，后面的就好说了，一步步来嘛！我平时都是用的windows，这里就只记录windows啦... ]]></description>
			<content:encoded><![CDATA[<p>现如今，<a href="http://cygwin.com/">node</a>大热，不弄弄，那不落伍了！服务器端嘛，首先还是配置环境，第一步走出去了，后面的就好说了，一步步来嘛！我平时都是用的windows，这里就只记录windows啦！</p>
<h4>第一步：安装Cygwin</h4>
<p>Cygwin网站：<a href="http://cygwin.com/">http://cygwin.com/</a>，Cygwin是什么就不多说了，反正是必须的！先下载setup文件，就算安装完了这个文件也别删，以后万一还有用得着的地方！如果首次安装有些包忘记装了，还得用这个再次安装！我一开始就忘记了好几个包，导致浪费了好多时间！主要是记得第一个界面时选择“install from internet”，否则就会失败！</p>
<p>这里要装的包有：</p>
<h5>Devel</h5>
<ul>
<li>gcc-g++: C++ compiler</li>
<li>gcc-mingw-g++: Mingw32 support headers and libraries for GCC C++</li>
<li>gcc4-g++: G++ subpackage</li>
<li>git: Fast Version Control System – core files</li>
<li>make: The GNU version of the &#8216;make&#8217; utility</li>
<li>openssl-devel: The OpenSSL development environment</li>
<li>pkg-config: A utility used to retrieve information about installed libraries</li>
<li>zlib-devel: The zlib compression/decompression library (development)</li>
</ul>
<h5>Editor</h5>
<ul>
<li>vim: Vi IMproved &#8211; enhanced vi editor</li>
</ul>
<h5>Python</h5>
<ul>
<li>全部</li>
</ul>
<h5>Web 分类</h5>
<ul>
<li>wget: Utility to retrieve files from the WWW via HTTP and FTP</li>
<li>curl: Multi-protocol file transfer command-line tool</li>
</ul>
<p>接下来就是下载了，有朋友建议选择日本的镜像，挺快！然后就是漫长的等待了。</p>
<p><strong>如果你是win7用户</strong></p>
<ol>
<li>cmd命令行</li>
<li>进入cygwin安装目录下的bin子目录</li>
<li>运行ash.exe进入shell模式</li>
<li>./rebaseall -v</li>
<li>没有错误，完成，exit退出ash，关闭命令行窗口</li>
</ol>
<h4>第二步：安装Node.js</h4>
<ol>
<li>运行Cygwin</li>
<li>输入 wget http://nodejs.org/dist/node-v0.4.7.tar.gz 回车，下载node.js安装包。</li>
<li>输入 tar xf node-v0.4.7.tar.gz 回车。</li>
<li>输入 cd node-v0.4.7 回车。</li>
<li>输入 ./configure 回车。</li>
<li>输入 make 回车，可能要等一段时间！</li>
<li>输入 make install 回车。</li>
</ol>
<p>一切正常的话，node.js安装成功！现在可以输入 node &#8211;version 回车，查看node.js版本啦</p>
<h4>第三步：设置DNS并创建测试文件</h4>
<p>cygwin的安装目录下找到etc文件夹，创建一个resolv.conf，添加代码：</p>
<p><code><br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
</code></p>
<p>保存，关闭！</p>
<p>现在可以开始测试了，返回父目录，也就是cygwin的安装目录，新建一个js文件，命名test.js，输入：</p>
<p><div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #660;">var</span><span style="color: Gray;"> </span><span style="color: #404040;">http</span><span style="color: Gray;"> = </span><span style="color: #404040;">require</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">http</span><span style="color: #080;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #404040;">http</span><span style="color: Gray;">.</span><span style="color: #404040;">createServer</span><span style="color: Olive;">(</span><span style="color: #660;">function</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #404040;">request</span><span style="color: Gray;">, </span><span style="color: #404040;">response</span><span style="color: Olive;">)</span><span style="color: Gray;"> </span><span style="color: Olive;">{</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: #404040;">response</span><span style="color: Gray;">.</span><span style="color: #404040;">writeHead</span><span style="color: Olive;">(</span><span style="color: Maroon;">200</span><span style="color: Gray;">, </span><span style="color: Olive;">{</span><span style="color: #080;">'</span><span style="color: #066;">Content-Type</span><span style="color: #080;">'</span><span style="color: Gray;">: </span><span style="color: #080;">'</span><span style="color: #066;">text/html</span><span style="color: #080;">'</span><span style="color: Olive;">})</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; </span><span style="color: #404040;">response</span><span style="color: Gray;">.</span><span style="color: #404040;">end</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">&lt;b&gt;Hello World&lt;/b&gt;</span><span style="color: #080;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: Olive;">})</span><span style="color: Gray;">.</span><span style="color: #404040;">listen</span><span style="color: Olive;">(</span><span style="color: Maroon;">8888</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #404040;">console</span><span style="color: Gray;">.</span><span style="color: #404040;">log</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">Server running at http://127.0.0.1:8888/</span><span style="color: #080;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li></ol></div>
</p>
<p>回到cygwin命令窗口中输入 node /example.js 回车。</p>
<p>命令窗口中显示 Server running at http://127.0.0.1:8888/ </p>
<p>打开浏览器，输入http://127.0.0.1:8888/，成功了吧！</p>
<p><strong>npm下载、安装、使用</strong></p>
<p>npm是nodejs的软件包管理器，可以用它安装所需软件包并发布自己为nodejs写的软件包，它还管理软件包的依赖关系并做了其它一些很酷的事情。</p>
<ol>
<li>
<p>一行命令下载并安装npm</p>
<p><code>$ curl http://npmjs.org/install.sh | sh</code>
</li>
<li>
<p>npm安装node扩展包，同样是一行命令下载并安装好软件包</p>
<p><code>$ npm install <包名></code>
</li>
</ol>
<p>一些链接：</p>
<ul>
<li><a href="http://nodejs.org">node.js官方</a></li>
<li><a href="http://github.com/ry/node">node.js项目地址</a></li>
<li><a href="http://howtonode.org/">howtonode</a></li>
<li><a href="http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-nodejs">Stackoverflow</a></li>
<li><a href="http://www.douban.com/group/node.js/">豆瓣：node.js小组</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/xx-GXDBRHg8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/06/22/windows-nodejs-configuration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/06/22/windows-nodejs-configuration/</feedburner:origLink></item>
		<item>
		<title>imglazyload图片延迟加载(jQuery)</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/2v4ldaKxbHs/</link>
		<comments>http://11gz.com/blog/2011/06/20/imglazyload-jquery/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 12:13:26 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[JS/Ajax/AS]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=569</guid>
		<description><![CDATA[这个小效果3个月前就写了，太忙，一直没空更新blog，刚好有点空闲，抽出来简单弄弄了~container容器，attr属性，timeout延时。这些都可以有自己灵活控制的！原理简单不过了，图片先不设置src属... ]]></description>
			<content:encoded><![CDATA[<p>这个小效果还是3个月前写的，太忙，一直没空更新blog，刚好有点空闲，抽出来简单弄弄了~</p>
<p>container容器，attr属性，timeout延时。这些都可以有自己灵活控制的！原理简单不过了，图片先不设置src属性，浏览器就不会产生请求，监听起滚动条和窗口大小的事件，通过判断图片是否处于当前可视区域(offset的left和top方向分别小于scrollTop+clientHeight和scrollLeft+clientWidth)来控制图片是否显示，显示则设置img对象的src属性为标签中自定义属性的值！</p>
<h4>主要代码</h4>
<div class="hl-surround"><div class="hl-main"><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">container</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">options</span><span style="color: Gray;">.</span><span style="color: #404040;">container</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">imgNum</span><span style="color: Gray;"> = </span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">container</span><span style="color: Gray;">.</span><span style="color: #404040;">find</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">img[</span><span style="color: #080;">'</span><span style="color: Gray;">+ </span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">options</span><span style="color: Gray;">.</span><span style="color: #404040;">attr</span><span style="color: Gray;"> +</span><span style="color: #080;">'</span><span style="color: #066;">]</span><span style="color: #080;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: #660;">var</span><span style="color: Gray;"> </span><span style="color: #404040;">_this</span><span style="color: Gray;"> = </span><span style="color: #660;">this</span><span style="color: Gray;">;<br /></span><span style="color: #660;">if</span><span style="color: Olive;">(</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">imgNum</span><span style="color: Gray;">.</span><span style="color: #404040;">length</span><span style="color: Olive;">){</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">timer</span><span style="color: Gray;">&amp;&amp;</span><span style="color: #404040;">clearTimeout</span><span style="color: Olive;">(</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">timer</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">timer</span><span style="color: Gray;"> = </span><span style="color: #404040;">setTimeout</span><span style="color: Olive;">(</span><span style="color: #660;">function</span><span style="color: Olive;">(){</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #660;">var</span><span style="color: Gray;"> </span><span style="color: #404040;">arr</span><span style="color: Gray;"> = </span><span style="color: Olive;">[]</span><span style="color: Gray;">,</span><span style="color: #404040;">gc</span><span style="color: Gray;"> = </span><span style="color: #404040;">_this</span><span style="color: Gray;">.</span><span style="color: #404040;">getClient</span><span style="color: Olive;">()</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;$.</span><span style="color: #404040;">each</span><span style="color: Olive;">(</span><span style="color: #404040;">_this</span><span style="color: Gray;">.</span><span style="color: #404040;">imgNum</span><span style="color: Gray;">,</span><span style="color: #660;">function</span><span style="color: Olive;">(</span><span style="color: #404040;">i</span><span style="color: Gray;">,</span><span style="color: #404040;">o</span><span style="color: Olive;">){</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #660;">if</span><span style="color: Olive;">(</span><span style="color: Gray;">$</span><span style="color: Olive;">(</span><span style="color: #404040;">o</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">offset</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: #404040;">top</span><span style="color: Gray;"> &lt;= </span><span style="color: #404040;">gc</span><span style="color: Gray;">.</span><span style="color: #404040;">top</span><span style="color: Gray;"> &amp;&amp; $</span><span style="color: Olive;">(</span><span style="color: #404040;">o</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">offset</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: #404040;">left</span><span style="color: Gray;"> &lt;= </span><span style="color: #404040;">gc</span><span style="color: Gray;">.</span><span style="color: #404040;">left</span><span style="color: Olive;">){</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #660;">var</span><span style="color: Gray;"> </span><span style="color: #404040;">attrval</span><span style="color: Gray;"> = $</span><span style="color: Olive;">(</span><span style="color: #404040;">o</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">attr</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">lazysrc</span><span style="color: #080;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span><span style="color: #404040;">attrval</span><span style="color: Gray;">&amp;&amp;$</span><span style="color: Olive;">(</span><span style="color: #404040;">o</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">attr</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">src</span><span style="color: #080;">'</span><span style="color: Gray;">,</span><span style="color: #404040;">attrval</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">removeAttr</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">lazysrc</span><span style="color: #080;">'</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">hide</span><span style="color: Olive;">()</span><span style="color: Gray;">.</span><span style="color: #404040;">fadeIn</span><span style="color: Olive;">()</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">}</span><span style="color: #660;">else</span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #404040;">arr</span><span style="color: Gray;">.</span><span style="color: #404040;">push</span><span style="color: Olive;">(</span><span style="color: #404040;">o</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">}</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: Olive;">})</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color: #404040;">_this</span><span style="color: Gray;">.</span><span style="color: #404040;">imgNum</span><span style="color: Gray;"> = </span><span style="color: #404040;">arr</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;</span><span style="color: Olive;">}</span><span style="color: Gray;">,</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">options</span><span style="color: Gray;">.</span><span style="color: #404040;">timeout</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: Olive;">}</span><span style="color: #660;">else</span><span style="color: Olive;">{</span><span style="color: Gray;"><br />&nbsp;&nbsp; &nbsp;$</span><span style="color: Olive;">(</span><span style="color: Teal;">window</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">unbind</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">scroll</span><span style="color: #080;">'</span><span style="color: Gray;">,</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">check</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br />&nbsp;&nbsp; &nbsp;$</span><span style="color: Olive;">(</span><span style="color: Teal;">window</span><span style="color: Olive;">)</span><span style="color: Gray;">.</span><span style="color: #404040;">unbind</span><span style="color: Olive;">(</span><span style="color: #080;">'</span><span style="color: #066;">resize</span><span style="color: #080;">'</span><span style="color: Gray;">,</span><span style="color: #660;">this</span><span style="color: Gray;">.</span><span style="color: #404040;">check</span><span style="color: Olive;">)</span><span style="color: Gray;">;<br /></span><span style="color: Olive;">}</span></div></div>
<h4>返回当前屏幕显示范围</h4>
<div class="hl-surround"><div class="hl-main"><span style="color: #660;">return</span><span style="color: Olive;">{</span><span style="color: #080;">'</span><span style="color: #066;">top</span><span style="color: #080;">'</span><span style="color: Gray;">:</span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: #404040;">documentElement</span><span style="color: Gray;">.</span><span style="color: #404040;">clientHeight</span><span style="color: Gray;">+</span><span style="color: Teal;">Math</span><span style="color: Gray;">.</span><span style="color: #404040;">max</span><span style="color: Olive;">(</span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: #404040;">documentElement</span><span style="color: Gray;">.</span><span style="color: #404040;">scrollTop</span><span style="color: Gray;">,</span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: #404040;">body</span><span style="color: Gray;">.</span><span style="color: #404040;">scrollTop</span><span style="color: Olive;">)</span><span style="color: Gray;">,</span><span style="color: #080;">'</span><span style="color: #066;">left</span><span style="color: #080;">'</span><span style="color: Gray;">:</span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: #404040;">documentElement</span><span style="color: Gray;">.</span><span style="color: #404040;">clientWidth</span><span style="color: Gray;">+</span><span style="color: Teal;">Math</span><span style="color: Gray;">.</span><span style="color: #404040;">max</span><span style="color: Olive;">(</span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: #404040;">documentElement</span><span style="color: Gray;">.</span><span style="color: #404040;">scrollLeft</span><span style="color: Gray;">,</span><span style="color: Teal;">document</span><span style="color: Gray;">.</span><span style="color: #404040;">body</span><span style="color: Gray;">.</span><span style="color: #404040;">scrollLeft</span><span style="color: Olive;">)}</span><span style="color: Gray;">;</span></div></div>
<p>demo展示：<a href="http://www.11gz.com/demo/js-ajax/imglazyload.html" title="http://www.11gz.com/demo/js-ajax/imglazyload.html">http://www.11gz.com/demo/js-ajax/imglazyload.html</a></p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/2v4ldaKxbHs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/06/20/imglazyload-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/06/20/imglazyload-jquery/</feedburner:origLink></item>
		<item>
		<title>IE6正在消亡</title>
		<link>http://feed.11gz.com/~r/Heluyao/~3/EGQus41nXDg/</link>
		<comments>http://11gz.com/blog/2011/04/05/internet-explorer-6-countdown/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 09:29:35 +0000</pubDate>
		<dc:creator>heluyao</dc:creator>
				<category><![CDATA[html/css/xml/xsl]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[兼容]]></category>

		<guid isPermaLink="false">http://www.11gz.com/blog/?p=567</guid>
		<description><![CDATA[IE6在欧美地区已经消失得差不多了，现在重症区是亚洲，中国肯定是排在第一名的，呵呵~好在还有韩国作陪，再下面就是印度、日本了... ]]></description>
			<content:encoded><![CDATA[<p><a href="http://ie6countdown.com/" title="http://ie6countdown.com/">http://ie6countdown.com/</a></p>
<p>IE6在欧美地区已经消失得差不多了，现在重症区是亚洲，中国肯定是排在第一名的，呵呵~！好在还有韩国作陪，再下面就是印度、日本了。最厉害的还是芬兰和挪威，都是小于1个芭仙！</p>
<p>期待着IE6早日“灭绝”，也好给我们这群写代码的省点时间，提高点编码效率！</p>
<img src="http://feeds.feedburner.com/~r/Heluyao/~4/EGQus41nXDg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://11gz.com/blog/2011/04/05/internet-explorer-6-countdown/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://11gz.com/blog/2011/04/05/internet-explorer-6-countdown/</feedburner:origLink></item>
	<media:rating>nonadult</media:rating></channel>
</rss>

