<?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>写笔记的小JOE页</title>
	<atom:link href="http://xiebiji.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://xiebiji.com</link>
	<description>Joe&#039;s Notebook</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:05:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>我们心里都有个房子</title>
		<link>http://xiebiji.com/2012/02/january-summary/</link>
		<comments>http://xiebiji.com/2012/02/january-summary/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 08:23:16 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2596</guid>
		<description><![CDATA[
我们心里都有个房子；
房子里有好多房间，好多人来看房；
我们有时候错觉地认为某个人会住下来，后来才发现她们只是过场的；
后来，
有一个人真住下来了，我们就把最大的房间留给第一个她；
不管外面风雨再大，她就住在那，一直都不会搬走；
我们有空就敲敲房门，打开门看一下，打扫打扫；
慢慢地进来住的人多，我们就把房子修大了，隔了更多的小房间，却没有一间比那间大；
但所有的房间里有那么一间，
可能是最大的那间，也可能不是；
里头住的人可能是第一个她，也可能不是；
我们永远都清楚知道里头是怎么布置的，墙壁是什么颜色的、花盘放哪的、被单是不是乱放着的…
因为，
我们自己也住在那；
我们没法选择最大的那间，却有办法选择最舒适的那间。
而一切都没变，只有那房子一直在变强变大。
心都是活的，心也在成长着。
更多的文章2009-07-27 -- 再发现一种css hack方法2009-07-09 -- 终于考完试了！2009-01-29 -- [转]div+css多浏览器兼容的几个技巧2008-08-24 -- 无意中看了一下Q群，发现一张很有意思的图片！我汗！2009-12-20 -- 有人请吃Buffet，我都记得]]></description>
			<content:encoded><![CDATA[<div><img class="alignnone size-full wp-image-2597" title="m_1325249423941" src="http://xiebiji.com/wp-content/uploads/2012/02/m_1325249423941.jpg" alt="" width="600" height="379" /></div>
<p>我们心里都有个房子；</p>
<p>房子里有好多房间，好多人来看房；</p>
<p>我们有时候错觉地认为某个人会住下来，后来才发现她们只是过场的；</p>
<p>后来，</p>
<p>有一个人真住下来了，我们就把最大的房间留给第一个她；</p>
<p>不管外面风雨再大，她就住在那，一直都不会搬走；</p>
<p>我们有空就敲敲房门，打开门看一下，打扫打扫；</p>
<p>慢慢地进来住的人多，我们就把房子修大了，隔了更多的小房间，却没有一间比那间大；</p>
<p>但所有的房间里有那么一间，</p>
<p>可能是最大的那间，也可能不是；</p>
<p>里头住的人可能是第一个她，也可能不是；</p>
<p>我们永远都清楚知道里头是怎么布置的，墙壁是什么颜色的、花盘放哪的、被单是不是乱放着的…</p>
<p>因为，</p>
<p>我们自己也住在那；</p>
<p>我们没法选择最大的那间，却有办法选择最舒适的那间。</p>
<p>而一切都没变，只有那房子一直在变强变大。</p>
<p>心都是活的，心也在成长着。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-04-21 -- <a href="http://xiebiji.com/2009/04/i-wui/" title="终于上线啦！I-WUI前端工作室启动！">终于上线啦！I-WUI前端工作室启动！</a></li><li>2010-12-18 -- <a href="http://xiebiji.com/2010/12/nianhui/" title="公司年会，让我如此得感动">公司年会，让我如此得感动</a></li><li>2008-09-28 -- <a href="http://xiebiji.com/2008/09/tianshi/" title="天使狠心地把天使之翼带走了">天使狠心地把天使之翼带走了</a></li><li>2009-12-01 -- <a href="http://xiebiji.com/2009/12/jsevent/" title="js事件、事件处理研究，关键字：event、传播">js事件、事件处理研究，关键字：event、传播</a></li><li>2010-05-27 -- <a href="http://xiebiji.com/2010/05/active_div/" title="多层div相互层叠激活方法（提升z-index）">多层div相互层叠激活方法（提升z-index）</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2012/02/january-summary/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>12月总结 &#8211; 奔向末日前的迷茫</title>
		<link>http://xiebiji.com/2012/01/summary-2/</link>
		<comments>http://xiebiji.com/2012/01/summary-2/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 02:40:02 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2582</guid>
		<description><![CDATA[2011年就这样过去了。
元旦已经过了一天，昨晚跟一女生聊天，别人说她不知道自己想要什么。
我霎时间没想到要怎么安慰她，因为我也不知道自己想要什么。
也许大家都会迷茫，都在想未来的路是怎样的，生活方式？工作？爱人？
这过去的12月，迷茫了。
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
工作上，自己是不是在浪费青春？
为什么羡慕别人知道之多。
是氛围不对，还是自己想得不对。
唯一确定的是到今年7月份，两年之期就到，路要怎么选择？
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
感情上，
不能弄不清自己想要什么，不然会伤害人。
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
生活还在继续嘛。
从前有个朋友她换了个工作氛围，又单身了，她以前说过一句话：好多事情都好像不重要了。
这也许是好多一路走过来的人必然会有的感想，只是迟早的问题吧。
各种迷茫都不重要，能有信就好了吧。
如果觉得未来是黑的，那现在活好，把开心的事情记下来，最后也许会发现其实早就有了想要的生活方式。这世界太多东西值得去欣赏，不知道自己想要什么，谁能肯定一定是坏事呢？
我们都没法把时间倒着过，但留下的言语却能倒着看。
文章写到这里，听到了《My Lucky Day》
“不久，我会微笑 
 一切都将好 
 我将不用担心了 
 这将是我的幸运日 ”
谁都会消失，如果把消失理解成悲剧，我们每个人最后都是悲剧，那留一片欢乐就好。
这末日前的迷茫，也许是冥冥中美好未来的启示罢了。
一切都在昭示着一个我们想要的结果。
更多的文章2009-11-08 -- 从开始到结束，腾讯校园招聘，凯旋归来2009-05-18 -- PHP 字符串省略形式输出[兼容所有编码]2011-02-20 -- 2011年第一篇总结[1、2月]2008-08-10 -- 网上找来说的比较好的wp-postviews的插件教程2008-09-03 -- !!!ALEXA排名又上升100W!!]]></description>
			<content:encoded><![CDATA[<p>2011年就这样过去了。</p>
<p>元旦已经过了一天，昨晚跟一女生聊天，别人说她不知道自己想要什么。</p>
<p>我霎时间没想到要怎么安慰她，因为我也不知道自己想要什么。</p>
<p>也许大家都会迷茫，都在想未来的路是怎样的，生活方式？工作？爱人？</p>
<p>这过去的12月，迷茫了。</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>工作上，自己是不是在浪费青春？</p>
<p>为什么羡慕别人知道之多。</p>
<p>是氛围不对，还是自己想得不对。</p>
<p>唯一确定的是到今年7月份，两年之期就到，路要怎么选择？</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>感情上，</p>
<p>不能弄不清自己想要什么，不然会伤害人。</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>生活还在继续嘛。</p>
<p>从前有个朋友她换了个工作氛围，又单身了，她以前说过一句话：好多事情都好像不重要了。</p>
<p>这也许是好多一路走过来的人必然会有的感想，只是迟早的问题吧。</p>
<p>各种迷茫都不重要，能有信就好了吧。</p>
<p>如果觉得未来是黑的，那现在活好，把开心的事情记下来，最后也许会发现其实早就有了想要的生活方式。这世界太多东西值得去欣赏，不知道自己想要什么，谁能肯定一定是坏事呢？</p>
<p>我们都没法把时间倒着过，但留下的言语却能倒着看。</p>
<p>文章写到这里，听到了《My Lucky Day》</p>
<p><span style="color: #c0c0c0;">“不久，我会微笑 </span></p>
<p><span style="color: #c0c0c0;"> 一切都将好 </span></p>
<p><span style="color: #c0c0c0;"> 我将不用担心了 </span></p>
<p><span style="color: #c0c0c0;"> 这将是我的幸运日 ”</span></p>
<p>谁都会消失，如果把消失理解成悲剧，我们每个人最后都是悲剧，那留一片欢乐就好。</p>
<p>这末日前的迷茫，也许是冥冥中美好未来的启示罢了。</p>
<p>一切都在昭示着一个我们想要的结果。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2008-12-24 -- <a href="http://xiebiji.com/2008/12/merry-christmas/" title="又到圣诞，圣诞快乐啊！Merry Christmas!">又到圣诞，圣诞快乐啊！Merry Christmas!</a></li><li>2008-08-26 -- <a href="http://xiebiji.com/2008/08/%e7%8e%af%e4%bf%9d%e7%9a%84%e5%88%9b%e6%84%8f%e8%ae%be%e8%ae%a1%ef%bc%8c%e6%bc%82%e4%ba%ae%e7%8e%af%e4%bf%9d%e8%a2%8b%ef%bc%81/" title="环保的创意设计，漂亮环保袋！">环保的创意设计，漂亮环保袋！</a></li><li>2009-06-17 -- <a href="http://xiebiji.com/2009/06/mootools-ajax-json/" title="mootools中文实例诠释&#8211;1.2版AJAX,JSON运用">mootools中文实例诠释&#8211;1.2版AJAX,JSON运用</a></li><li>2008-11-29 -- <a href="http://xiebiji.com/2008/11/textoverflow/" title="text-overflow兼容主流浏览器,css限制单行字符长度方法">text-overflow兼容主流浏览器,css限制单行字符长度方法</a></li><li>2008-10-31 -- <a href="http://xiebiji.com/2008/10/laopopo/" title="那位老婆婆。。。">那位老婆婆。。。</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2012/01/summary-2/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>11月总结 &#8212; 是好的，做，就对了</title>
		<link>http://xiebiji.com/2011/12/11%e6%9c%88%e6%80%bb%e7%bb%93-%e6%98%af%e5%a5%bd%e7%9a%84%ef%bc%8c%e5%81%9a%ef%bc%8c%e5%b0%b1%e5%af%b9%e4%ba%86/</link>
		<comments>http://xiebiji.com/2011/12/11%e6%9c%88%e6%80%bb%e7%bb%93-%e6%98%af%e5%a5%bd%e7%9a%84%ef%bc%8c%e5%81%9a%ef%bc%8c%e5%b0%b1%e5%af%b9%e4%ba%86/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 14:41:13 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2580</guid>
		<description><![CDATA[11月是我这上半辈子最值得怀念的一个月。
工作方面，无时无刻我都在转变。
早上上班，下公交车到公司的那段路，我习惯性地思量自己的工作表现，思量往后要怎么发展。
却未果。
生活方面，好像已经趋近一种习惯了，下班不是看书就是弹琴，又或是聚会，一眨眼一个星期就过去了。
好多东西都想学，都想做，却不知所措。开始有点迷茫往后的路该怎么走了。
我有自己的梦想，却没有把梦想按时间段具体量化成现实的目标。
想很多，知道要留意，却留意不多。
想得到很多，却越是想得到，越是难以得到。
明白了一个道理，好多事情已经不重要了，重要的是自己是什么感觉，而别人都没义务去理会我感受。
我不能太矫情了。
唯一知道、必定要做的是，要找个时间把一个长期的计划写出来。
只要严格执行一个对自己好的计划，我相信就算迷茫，也会在迷茫中慢慢找到方向吧。
是好的，做，就对了。
更多的文章2010-12-18 -- 公司年会，让我如此得感动2009-03-13 -- 小作。。。2009-04-10 -- 小型项目管理系统上线2008-10-02 -- 哇！突然发现本博客的PR大跃进到PR32008-08-22 -- 原创用MOOTOOLS做的超简单wp插件&#8211;最近5条日志标题（last5posts）]]></description>
			<content:encoded><![CDATA[<p>11月是我这上半辈子最值得怀念的一个月。</p>
<p>工作方面，无时无刻我都在转变。</p>
<p>早上上班，下公交车到公司的那段路，我习惯性地思量自己的工作表现，思量往后要怎么发展。</p>
<p>却未果。</p>
<p>生活方面，好像已经趋近一种习惯了，下班不是看书就是弹琴，又或是聚会，一眨眼一个星期就过去了。</p>
<p>好多东西都想学，都想做，却不知所措。开始有点迷茫往后的路该怎么走了。</p>
<p>我有自己的梦想，却没有把梦想按时间段具体量化成现实的目标。</p>
<p>想很多，知道要留意，却留意不多。</p>
<p>想得到很多，却越是想得到，越是难以得到。</p>
<p>明白了一个道理，好多事情已经不重要了，重要的是自己是什么感觉，而别人都没义务去理会我感受。</p>
<p>我不能太矫情了。</p>
<p>唯一知道、必定要做的是，要找个时间把一个长期的计划写出来。</p>
<p>只要严格执行一个对自己好的计划，我相信就算迷茫，也会在迷茫中慢慢找到方向吧。</p>
<p>是好的，做，就对了。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-10-15 -- <a href="http://xiebiji.com/2009/10/%e6%9c%80%e8%bf%91%e7%94%bb%e4%ba%86%e5%b9%85%e7%94%bb/" title="最近画了幅画">最近画了幅画</a></li><li>2011-10-23 -- <a href="http://xiebiji.com/2011/10/pro_done/" title="问题分析与解决学习">问题分析与解决学习</a></li><li>2009-07-14 -- <a href="http://xiebiji.com/2009/07/as3%e4%b8%ad%e8%ae%a9%e5%bd%b1%e7%89%87%e5%89%aa%e8%be%91%e5%83%8f%e6%8c%89%e9%92%ae%e4%b8%80%e6%a0%b7%ef%bc%8c%e6%98%be%e7%a4%ba%e9%bc%a0%e6%a0%87%e6%8c%87%e9%92%88/" title="AS3中让影片剪辑像按钮一样，显示鼠标指针 ">AS3中让影片剪辑像按钮一样，显示鼠标指针 </a></li><li>2008-12-24 -- <a href="http://xiebiji.com/2008/12/mootools-ajax-simple/" title="【mootools中文实例诠释】Ajax类的简单使用 ">【mootools中文实例诠释】Ajax类的简单使用 </a></li><li>2009-08-08 -- <a href="http://xiebiji.com/2009/08/%e5%8f%91%e7%8e%b0%e4%b8%a4%e4%b8%aa%e6%af%94%e8%be%83%e9%80%82%e5%90%88%e6%88%91%e7%9c%8b%e7%9a%84%e8%8b%b1%e6%96%87%e5%8d%9a%e5%ae%a2%ef%bc%8c%e8%ae%b0%e4%b8%8b%e6%9d%a5%ef%bc%81/" title="发现两个比较适合我看的英文博客，记下来！">发现两个比较适合我看的英文博客，记下来！</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/12/11%e6%9c%88%e6%80%bb%e7%bb%93-%e6%98%af%e5%a5%bd%e7%9a%84%ef%bc%8c%e5%81%9a%ef%bc%8c%e5%b0%b1%e5%af%b9%e4%ba%86/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>10月总结 &#8212; 得到越多，就要明白得不到或失去时有多悲痛。</title>
		<link>http://xiebiji.com/2011/11/october_summary/</link>
		<comments>http://xiebiji.com/2011/11/october_summary/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 03:54:25 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2568</guid>
		<description><![CDATA[最近感情问题比较多，多聪明的人都会被情所困，何况是我这种中庸之辈呢？
工作方面：
自从架构调整后，大伙都很沉寂，沉寂得有点令人心寒。
很明显我需要从新审视这个局面。
专业自闭=慢性自杀。
太多的细节这里还是不谈了。
生活方面：
有几个点需要记一下：
1. 我正随心所行。
这种随心放纵必然引发一个方向选择的问题。一直在变，为以防自己会往坏的方向发展，我需要明确一些事情。
梦想
我有最终想追求的生活，所谓的梦想，这即使在很多人看来是多么渺小的梦想，渺小得我不愿意在这里谈及，但我觉得我是幸运的，起码我有那么一个方向。
现实
我有的，我没的；我即将得到的，我即将失去的；我创造的，我毁掉的。
2. 往后更困难。
拿得起放得下
前路有多困难，即使是悲剧的收场，也要努力把过程点缀成美好的回忆。纸花没有活花的容颜，也要有追求的权利，也要有自尊的心。也许就一镜花水月罢了。

3. 重新认识这个世界。
跨出一步
朋友说我活在自己的世界里。只因我知道的太少，外面的世界想认识我，我却没有让它融入我的世界。

10月的厦门游，把心的感觉明确了，不后悔了。
最后真心觉得：
得到越多，就要明白得不到或失去时有多悲痛。
更多的文章2008-09-10 -- 各路傻瓜将汇聚中秋夜！2008-11-25 -- if IE html里面的条件控制语句2009-04-11 -- 昨晚听了个交流会，感觉说不出来2008-08-26 -- 整理的一个真正中文mootools教程2008-09-15 -- Tutorial For WP-DownloadManager Plugin&#124;中文教程]]></description>
			<content:encoded><![CDATA[<p>最近感情问题比较多，多聪明的人都会被情所困，何况是我这种中庸之辈呢？</p>
<p><strong>工作方面：</strong></p>
<p>自从架构调整后，大伙都很沉寂，沉寂得有点令人心寒。</p>
<p>很明显我需要从新审视这个局面。</p>
<p>专业自闭=慢性自杀。</p>
<p>太多的细节这里还是不谈了。</p>
<p><strong>生活方面：</strong></p>
<p>有几个点需要记一下：</p>
<p>1. 我正随心所行。</p>
<p>这种随心放纵必然引发一个方向选择的问题。一直在变，为以防自己会往坏的方向发展，我需要明确一些事情。</p>
<p><em style="font-style: italic;">梦想</em></p>
<p>我有最终想追求的生活，所谓的梦想，这即使在很多人看来是多么渺小的梦想，渺小得我不愿意在这里谈及，但我觉得我是幸运的，起码我有那么一个方向。</p>
<p><em style="font-style: italic;">现实</em></p>
<p>我有的，我没的；我即将得到的，我即将失去的；我创造的，我毁掉的。</p>
<p>2. 往后更困难。</p>
<p><em style="font-style: italic;">拿得起放得下</em></p>
<p>前路有多困难，即使是悲剧的收场，也要努力把过程点缀成美好的回忆。纸花没有活花的容颜，也要有追求的权利，也要有自尊的心。也许就一镜花水月罢了。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/11/IMG_0486.jpg"><img class="alignnone size-full wp-image-2569" title="IMG_0486" src="http://xiebiji.com/wp-content/uploads/2011/11/IMG_0486.jpg" alt="" width="600" height="448" /></a></p>
<p>3. 重新认识这个世界。</p>
<p><em style="font-style: italic;">跨出一步</em></p>
<p>朋友说我活在自己的世界里。只因我知道的太少，外面的世界想认识我，我却没有让它融入我的世界。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/11/DSC_0135.jpg"><img class="alignnone size-full wp-image-2570" title="DSC_0135" src="http://xiebiji.com/wp-content/uploads/2011/11/DSC_0135.jpg" alt="" width="800" height="494" /></a></p>
<p>10月的厦门游，把心的感觉明确了，不后悔了。</p>
<p>最后真心觉得：</p>
<p>得到越多，就要明白得不到或失去时有多悲痛。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2008-11-08 -- <a href="http://xiebiji.com/2008/11/wuliao/" title="人无聊的时候什么都会干出来~">人无聊的时候什么都会干出来~</a></li><li>2010-11-13 -- <a href="http://xiebiji.com/2010/11/october_note/" title="10月总结">10月总结</a></li><li>2009-07-14 -- <a href="http://xiebiji.com/2009/07/as3%e4%b8%ad%e8%ae%a9%e5%bd%b1%e7%89%87%e5%89%aa%e8%be%91%e5%83%8f%e6%8c%89%e9%92%ae%e4%b8%80%e6%a0%b7%ef%bc%8c%e6%98%be%e7%a4%ba%e9%bc%a0%e6%a0%87%e6%8c%87%e9%92%88/" title="AS3中让影片剪辑像按钮一样，显示鼠标指针 ">AS3中让影片剪辑像按钮一样，显示鼠标指针 </a></li><li>2009-09-25 -- <a href="http://xiebiji.com/2009/09/web-2/" title="你够不够“网络化”？">你够不够“网络化”？</a></li><li>2008-11-12 -- <a href="http://xiebiji.com/2008/11/ibm/" title="囧一个，学校请来的IBM讲座">囧一个，学校请来的IBM讲座</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/11/october_summary/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>问题分析与解决学习</title>
		<link>http://xiebiji.com/2011/10/pro_done/</link>
		<comments>http://xiebiji.com/2011/10/pro_done/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 14:12:24 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2557</guid>
		<description><![CDATA[学习《问题分析与解决》，记了点笔记。
开始之前推荐了一些书《思考的技术》《高效能人士的七个习惯》
得到以下各种结论：
一.认识问题
这是有意思的一个环节，我们提问题时往往有可能连问题都没找到。首先要理清问题的本质：是现状与目标，标准或期望发生了差距。
问题不是一种判断，不仅仅是一个事实，也不是原因、解决方案。
我们举了个例子来说明这个事情，故事是这样的：他老婆的哥哥生日了，于是他老婆就给他说“你觉得我们是给600块还是1000块呢？”
这句话是一个合理的问题么？不是，期望的是让她哥哥在生日那天开心，她哥哥缺钱么？不缺，送钱不符合期望。还不如回归事实真相，收集资料，看她哥哥是喜欢什么的，送一份有心意的礼物即可。
这反映了一个什么现象？
我们往往在提问题的时候就不自觉地加上了解决方案。
提问题需要技巧和方法，具体怎么做呢？
可以用4W2H的方法来提取问题。该方法很简单，以What(事物)、Who(人)、When（时间）、Where(地点)、How(方式)、How Many(Much)(程度)来描述一个事情，就能做出总结提出问题。具体大家可以查阅相关资料。当这几个维度都分析过之后，问题真正形态自然就出现了。
二.问题原因分析
主体思路是这样的：找出所有原因-&#62;确定根本原因
1.找出所有原因，可以用头脑风暴的方法(我们可以尝试一下用MindManager辅助来做头脑风暴)，当找出很多不同原因之后，我们分类并且合并所有原因。
2.确定根本原因，这里的依据是“二八法则” &#8212; 一项事物中约20%的要素却决定或拥有80%的结果。
寻找根因，有几种方法：
a. 5W法
对于较为简单、范围较窄的原因分析，我们可以用5W法，即如：为什么A，因为B；为什么B，因为C；为什么C，因为D；为什么D，因为E。最终E即为根因。
b. 要因分析法
较适合复杂、非量化的原因分析。主要做法是找出所有因素之间的因果关系，经过简单的符号运算，就此评判出原因体系的一种方法。

列个图表研究因素之间的关系，是因记-1分，是果记1分。
临界域为: [最小值/2,最大值/2]
在域的左边为根因，域内为过渡因，右边为近因。
c. MECE法（逻辑树）
这个大家可以翻阅资料，这里不累述。
三.其他内容
课程内容很多，不能一一列举，这里说一点简单易懂的。
关于产生创意的方法：强制关联法、属性列举法/质问法
而产生创意思维的条件，有好几个，我觉得值得一提的是：营造创意环境，也就是说每个人在特定的环境下会激发自己的创意思维，例如说在听某首音乐曲子的时候。我们可以寻求一下自己的创意氛围。
课程还很多内容，这里没能写全，如有错误请指出。
更多的文章2010-06-05 -- 我的目标们&#038;梦想2008-09-16 -- 18号要去广交会啦~2009-01-05 -- 博客所在的服务器居然被攻击了！！郁闷2009-08-05 -- 这&#8230;天分不够果然是个问题2008-11-08 -- 人无聊的时候什么都会干出来~]]></description>
			<content:encoded><![CDATA[<p>学习《问题分析与解决》，记了点笔记。</p>
<p>开始之前推荐了一些书《思考的技术》《高效能人士的七个习惯》</p>
<p>得到以下各种结论：</p>
<p>一.<strong>认识问题</strong></p>
<p style="padding-left: 30px;">这是有意思的一个环节，我们提问题时往往有可能连问题都没找到。首先要理清问题的本质：是<em>现状与目标，标准或期望发生了差距。</em></p>
<p style="padding-left: 30px;"><em>问题不是一种判断，不仅仅是一个事实，也不是原因、解决方案。</em></p>
<p style="padding-left: 30px;">我们举了个例子来说明这个事情，故事是这样的：他老婆的哥哥生日了，于是他老婆就给他说“你觉得我们是给600块还是1000块呢？”</p>
<p style="padding-left: 30px;">这句话是一个合理的问题么？不是，期望的是让她哥哥在生日那天开心，她哥哥缺钱么？不缺，送钱不符合期望。还不如回归事实真相，收集资料，看她哥哥是喜欢什么的，送一份有心意的礼物即可。</p>
<p style="padding-left: 30px;">这反映了一个什么现象？</p>
<p style="padding-left: 30px;"><em>我们往往在提问题的时候就不自觉地加上了解决方案。</em></p>
<p style="padding-left: 30px;">提问题需要技巧和方法，具体怎么做呢？</p>
<p style="padding-left: 30px;">可以用<em>4W2H</em>的方法来提取问题。该方法很简单，以<em>What(事物)、Who(人)、When（时间）、Where(地点)、How(方式)、How Many(Much)(程度)</em>来描述一个事情，就能做出总结提出问题。具体大家可以查阅相关资料。当这几个维度都分析过之后，问题真正形态自然就出现了。</p>
<p>二.<strong>问题原因分析</strong></p>
<p style="padding-left: 30px;">主体思路是这样的：找出所有原因-&gt;确定根本原因</p>
<p style="padding-left: 30px;">1.找出所有原因，可以用头脑风暴的方法(我们可以尝试一下用MindManager辅助来做头脑风暴)，当找出很多不同原因之后，我们分类并且合并所有原因。</p>
<p style="padding-left: 30px;">2.确定根本原因，这里的依据是“二八法则” &#8212; 一项事物中约20%的要素却决定或拥有80%的结果。</p>
<p style="padding-left: 30px;">寻找根因，有几种方法：</p>
<p style="padding-left: 60px;"><em>a. 5W法</em></p>
<p style="padding-left: 60px;">对于较为简单、范围较窄的原因分析，我们可以用5W法，即如：为什么A，因为B；为什么B，因为C；为什么C，因为D；为什么D，因为E。最终E即为根因。</p>
<p style="padding-left: 60px;"><em>b. 要因分析法</em></p>
<p style="padding-left: 60px;">较适合复杂、非量化的原因分析。主要做法是找出所有因素之间的因果关系，经过简单的符号运算，就此评判出原因体系的一种方法。</p>
<p style="padding-left: 60px;"><a href="http://xiebiji.com/wp-content/uploads/2011/10/IMG_0472.jpg"><img class="alignnone size-full wp-image-2558" title="IMG_0472" src="http://xiebiji.com/wp-content/uploads/2011/10/IMG_0472.jpg" alt="" width="1000" height="747" /></a></p>
<p style="padding-left: 60px;">列个图表研究因素之间的关系，是因记-1分，是果记1分。</p>
<p style="padding-left: 60px;"><em>临界域为: [最小值/2,最大值/2]</em></p>
<p style="padding-left: 60px;">在域的左边为根因，域内为过渡因，右边为近因。</p>
<p style="padding-left: 60px;">c. MECE法（逻辑树）</p>
<p style="padding-left: 60px;">这个大家可以翻阅资料，这里不累述。</p>
<p>三.<strong>其他内容</strong></p>
<p style="padding-left: 30px;">课程内容很多，不能一一列举，这里说一点简单易懂的。</p>
<p style="padding-left: 30px;">关于产生创意的方法：强制关联法、属性列举法/质问法</p>
<p style="padding-left: 30px;">而产生创意思维的条件，有好几个，我觉得值得一提的是：营造创意环境，也就是说每个人在特定的环境下会激发自己的创意思维，例如说在听某首音乐曲子的时候。我们可以寻求一下自己的创意氛围。</p>
<p>课程还很多内容，这里没能写全，如有错误请指出。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2010-08-01 -- <a href="http://xiebiji.com/2010/08/summery-7/" title="月度小结&#8211;7月">月度小结&#8211;7月</a></li><li>2009-09-26 -- <a href="http://xiebiji.com/2009/09/yuebing/" title="今天公司发月饼！！！好欢乐！">今天公司发月饼！！！好欢乐！</a></li><li>2009-05-09 -- <a href="http://xiebiji.com/2009/05/lovely/" title="可爱的飞机稿">可爱的飞机稿</a></li><li>2009-06-04 -- <a href="http://xiebiji.com/2009/06/%e4%b8%80%e4%b8%aa%e5%ae%b6%e5%85%b7%e8%b4%b8%e6%98%93%e7%bd%91%e8%ae%be%e8%ae%a1/" title="一个家具贸易网设计">一个家具贸易网设计</a></li><li>2012-02-11 -- <a href="http://xiebiji.com/2012/02/january-summary/" title="我们心里都有个房子">我们心里都有个房子</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/10/pro_done/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>9月总结</title>
		<link>http://xiebiji.com/2011/10/november_summary/</link>
		<comments>http://xiebiji.com/2011/10/november_summary/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 12:46:09 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2555</guid>
		<description><![CDATA[9月份与情感上有了不一样的感悟。
工作一年多，慢慢感觉以前忽视了感情修养的修炼。
慢慢觉得要变成熟，变稳重，但又力不从心。
我干了啥呢？
9月份我做了个重要的决定，我的阅历太少，我要多了解这个世界，于是有独自旅游的冲动（http://user.qzone.qq.com/23456325/blog/1316857461#!）。
当然除了旅游，要增长阅历的话，我还需要多看书。
于是，我决定每周起码去两次书城。然后每周六晚上到楼下咖啡厅看书或者发呆想东西。
一直在变，但总相信这一切都会导向一个好的结果。
更多的文章2009-08-20 -- 为了喜欢的游戏我又奢侈了1600rmb2011-02-15 -- js中html字符串格式化函数2009-04-08 -- 互相理解？2009-06-16 -- 前端敏捷开发-许湛 的演讲稿（Justin）2008-08-23 -- 新画的不知道什么风格的横标]]></description>
			<content:encoded><![CDATA[<p>9月份与情感上有了不一样的感悟。</p>
<p>工作一年多，慢慢感觉以前忽视了感情修养的修炼。</p>
<p>慢慢觉得要变成熟，变稳重，但又力不从心。</p>
<p>我干了啥呢？</p>
<p>9月份我做了个重要的决定，我的阅历太少，我要多了解这个世界，于是有独自旅游的冲动（<a href="http://user.qzone.qq.com/23456325/blog/1316857461#!">http://user.qzone.qq.com/23456325/blog/1316857461#!</a>）。</p>
<p>当然除了旅游，要增长阅历的话，我还需要多看书。</p>
<p>于是，我决定每周起码去两次书城。然后每周六晚上到楼下咖啡厅看书或者发呆想东西。</p>
<p>一直在变，但总相信这一切都会导向一个好的结果。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2008-08-21 -- <a href="http://xiebiji.com/2008/08/%e8%99%bd%e7%84%b6%e6%9c%89%e7%82%b9%e4%bc%a4%e5%bf%83%ef%bc%8c%e4%bd%86%e6%98%af%e5%b7%b2%e7%bb%8f%e8%bf%87%e5%8e%bb%e8%ae%a9%e5%ae%83%e8%b5%b0%e5%90%a7%ef%bc%8c%e4%b8%93%e5%bf%83%e5%86%99%e5%8d%9a/" title="虽然有点伤心，但是已经过去让它走吧，专心写博客了">虽然有点伤心，但是已经过去让它走吧，专心写博客了</a></li><li>2009-08-07 -- <a href="http://xiebiji.com/2009/08/%e6%af%8f%e5%a4%a9%e4%b8%b4%e6%91%b9%e7%bb%83%e4%b9%a0%ef%bc%8c%e6%88%91%e4%b8%8d%e4%bf%a1%e7%94%bb%e4%b8%8d%e5%a5%bd/" title="每天临摹练习，我不信画不好">每天临摹练习，我不信画不好</a></li><li>2010-01-31 -- <a href="http://xiebiji.com/2010/01/js_load/" title="实际上js文件放最后是个好方案，但有更好的方案">实际上js文件放最后是个好方案，但有更好的方案</a></li><li>2008-11-07 -- <a href="http://xiebiji.com/2008/11/enemy/" title="超推荐一部香港连续剧-《与敌同行》">超推荐一部香港连续剧-《与敌同行》</a></li><li>2009-06-17 -- <a href="http://xiebiji.com/2009/06/mootools-ajax-json/" title="mootools中文实例诠释&#8211;1.2版AJAX,JSON运用">mootools中文实例诠释&#8211;1.2版AJAX,JSON运用</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/10/november_summary/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>这么好的天气，应该出去走走。突如其来的天后宫。</title>
		<link>http://xiebiji.com/2011/09/lonely_travel/</link>
		<comments>http://xiebiji.com/2011/09/lonely_travel/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 09:52:46 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2544</guid>
		<description><![CDATA[








工作努力，生活随意。
这是我从一个公司高层的言语中学来的。
QQ空间不给外链图片，移步一下吧^_^
http://user.qzone.qq.com/23456325/blog/1316857461









更多的文章2009-09-28 -- DOM树里面某个元素各个位置属性的图文描述2008-12-24 -- 【mootools中文实例诠释】Ajax类的简单使用 2010-05-07 -- 这回冲动了！换笔记本电脑2008-08-26 -- 环保的创意设计，漂亮环保袋！2010-06-07 -- 小笔记两个]]></description>
			<content:encoded><![CDATA[<div>
<div id="pageContainer">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p><span style="font-size: x-small;">工作努力，生活随意。</span></p>
<p><span style="font-size: x-small;">这是我从一个公司高层的言语中学来的。</span></p>
<p>QQ空间不给外链图片，移步一下吧^_^</p>
<p><span style="font-size: xx-small;"><a href="http://user.qzone.qq.com/23456325/blog/1316857461">http://user.qzone.qq.com/23456325/blog/1316857461</a></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2008-08-24 -- <a href="http://xiebiji.com/2008/08/%e5%85%b3%e4%ba%8e%e9%9d%9ewp%e7%9b%ae%e5%bd%95%e4%b8%8b%e7%9a%84php%e6%96%87%e4%bb%b6%e6%98%be%e7%a4%ba%e6%96%87%e7%ab%a0%e6%91%98%e8%a6%81%e6%88%96%e8%80%85%e5%88%ab%e7%9a%84wp%e4%bf%a1%e6%81%af/" title="关于非WP目录下的.php文件显示文章摘要或者别的WP信息的方法">关于非WP目录下的.php文件显示文章摘要或者别的WP信息的方法</a></li><li>2008-10-29 -- <a href="http://xiebiji.com/2008/10/ad/" title="这几天做的一个简单广告管理系统">这几天做的一个简单广告管理系统</a></li><li>2009-06-10 -- <a href="http://xiebiji.com/2009/06/lightbox/" title="分享一个超强基于mootools v1.11版的multibox/lightbox">分享一个超强基于mootools v1.11版的multibox/lightbox</a></li><li>2009-06-16 -- <a href="http://xiebiji.com/2009/06/justin/" title="前端敏捷开发-许湛 的演讲稿（Justin）">前端敏捷开发-许湛 的演讲稿（Justin）</a></li><li>2009-06-09 -- <a href="http://xiebiji.com/2009/06/video/" title="看到“变形金刚”，大学生太有意思了，不得不分享">看到“变形金刚”，大学生太有意思了，不得不分享</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/09/lonely_travel/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>8.11泰国游，美好的一段经历。</title>
		<link>http://xiebiji.com/2011/08/travel_in_thailand/</link>
		<comments>http://xiebiji.com/2011/08/travel_in_thailand/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 05:07:40 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>
		<category><![CDATA[生活总结]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2491</guid>
		<description><![CDATA[首先晒个照片先，感觉这张拍的最好了，当然我还PS处理过一下的^_^! 注意：小单选不是我女朋友啊~

这是在看老虎的时候被偷拍的，当然左边那个是我啦。同事说很像在拍偶像剧喔！我居然也有这样的照片哈，挺欢乐的。
回归正题，我们是2011年8月11日到8月15日的泰国游。
鉴于我不常写旅游日志，以下内容就从简啦^_^。
整个旅游过程
星期四（11号那天），从公司下班就去深圳蛇口坐船去香港坐飞机，差不多10点才登机，下面的照片貌似是回来的时候拍的：

然后去到曼谷，我看了下iphone，显示的是深夜两点了，但实际上是国内的3点，泰国的时间比国内晚一个小时。Ps.这里说一下，iphone真强悍，自己会把时区调过来的，我当时就觉得自己奥特曼了。

所以到那边的时候已经很晚了，到了曼谷一家酒店后，到睡觉的时候已经是3点了（国内4点），给个酒店的照片：

对了，这里提醒一下去泰国旅游的朋友啦，记得要自己带牙刷牙膏什么的，因为泰国有些酒店不提供这些东西的。
第二天起来给外面拍了个照片，他们的私家车还挺好玩的：

具体旅游行程我有点混乱了，直接放照片吧。

建筑好奇特。

他们的出租车好多种颜色，几辆跑在一起的话，会好像一个赛车队似的。
大巴也很有特色

行程中我们参观一个叫“观音娘娘亭”的观光点，它是在海边的，要坐船在海上看，上船前，发现他们摆设还挺有意思的。那里的人还请我吃了一根很小的香蕉。

观音娘娘亭旁边其实有一尊佛的，传说，他死后，那里的鱼会游过来吃他的肉，于是那里的海边很多鱼。

这里没拍到那个佛像，但我们去到得时候，确实好多鱼在那里，游客喂它们吃面包。
这里坐船的时候我还是被偷拍了一张！

脖子上的花圈是有个泰国小孩卖的。嗯，这样看起来就像游客了。
之后我们还参观过了泰国的的宫殿：



整个宫殿金碧辉煌的。

他们的步兵走起路来很恶搞。
这里有个小分队合照：

我左边戴帽子的是我们的秘书mm,整个旅程真的很感谢她。
去完宫殿了，我们还去逛一些购物点


然后我们去了一个动物园
去芭提雅的时候，我们去了红灯区，那个叫震撼啊。重口味的不发了，怕和谐。

这是一条好多好多外国人的街，各种重口味bar，可以看到好多人妖。

上面站的人其实在跳脱衣舞的！
-___-!反正去那里让你毕生难忘的。
后来我们还到泰国最高的大楼吃自助餐：


还去了动物园看老虎、鳄鱼表演

还去了海滩，沙子是白色的哦！

各种忘记名字的餐馆


再后来，就是大型的人妖表演了，很有艺术感：




当然我们还看了大型的重口味表演，由于不给拍照片，这里就不放啦！
在旅游点经常有人偷拍（-_-!站在你面前拍照算偷拍么？）你的照片，然后做成各种东西，卖给你。

最后放个合影：

感受嘛，就是一辈子都值得回味的记忆啦。
更多的文章2008-11-12 -- 囧一个，学校请来的IBM讲座2008-12-25 -- 推荐博客表情一套！很简约喔！2008-08-22 -- 原创用MOOTOOLS做的超简单wp插件&#8211;最近5条日志标题（last5posts）2009-10-12 -- css reset样式初始化/重置默认样式2010-08-14 -- 一个简单的HTML类名命名思维]]></description>
			<content:encoded><![CDATA[<p>首先晒个照片先，感觉这张拍的最好了，当然我还PS处理过一下的^_^! 注意：小单选不是我女朋友啊~</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload.png"><img class="alignnone size-full wp-image-2492" title="http_imgload" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload.png" alt="" width="670" height="445" /></a></p>
<p>这是在看老虎的时候被偷拍的，当然左边那个是我啦。同事说很像在拍偶像剧喔！我居然也有这样的照片哈，挺欢乐的。</p>
<p>回归正题，我们是2011年8月11日到8月15日的泰国游。</p>
<p>鉴于我不常写旅游日志，以下内容就从简啦^_^。</p>
<p>整个旅游过程</p>
<p>星期四（11号那天），从公司下班就去深圳蛇口坐船去香港坐飞机，差不多10点才登机，下面的照片貌似是回来的时候拍的：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAXH51DT.jpg"><img class="alignnone size-full wp-image-2493" title="http_imgloadCAXH51DT" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAXH51DT.jpg" alt="" width="670" height="443" /></a></p>
<p>然后去到曼谷，我看了下iphone，显示的是深夜两点了，但实际上是国内的3点，泰国的时间比国内晚一个小时。Ps.这里说一下，iphone真强悍，自己会把时区调过来的，我当时就觉得自己奥特曼了。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0263.jpg"><img class="alignnone size-full wp-image-2494" title="IMG_0263" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0263.jpg" alt="" width="600" height="448" /></a></p>
<p>所以到那边的时候已经很晚了，到了曼谷一家酒店后，到睡觉的时候已经是3点了（国内4点），给个酒店的照片：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0266.jpg"><img class="alignnone size-full wp-image-2495" title="IMG_0266" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0266.jpg" alt="" width="600" height="448" /></a></p>
<p>对了，这里提醒一下去泰国旅游的朋友啦，记得要自己带牙刷牙膏什么的，因为泰国有些酒店不提供这些东西的。</p>
<p>第二天起来给外面拍了个照片，他们的私家车还挺好玩的：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0265.jpg"><img class="alignnone size-full wp-image-2496" title="IMG_0265" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0265.jpg" alt="" width="600" height="448" /></a></p>
<p>具体旅游行程我有点混乱了，直接放照片吧。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCA56BO9B.jpg"><img class="alignnone size-full wp-image-2504" title="http_imgloadCA56BO9B" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCA56BO9B.jpg" alt="" width="670" height="446" /></a></p>
<p>建筑好奇特。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/1.jpg"><img class="alignnone size-full wp-image-2497" title="1" src="http://xiebiji.com/wp-content/uploads/2011/08/1.jpg" alt="" width="670" height="446" /></a></p>
<p>他们的出租车好多种颜色，几辆跑在一起的话，会好像一个赛车队似的。</p>
<p>大巴也很有特色</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/21.jpg"><img class="alignnone size-full wp-image-2500" title="2" src="http://xiebiji.com/wp-content/uploads/2011/08/21.jpg" alt="" width="670" height="446" /></a></p>
<p>行程中我们参观一个叫“观音娘娘亭”的观光点，它是在海边的，要坐船在海上看，上船前，发现他们摆设还挺有意思的。那里的人还请我吃了一根很小的香蕉。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0268.jpg"><img class="alignnone size-full wp-image-2501" title="IMG_0268" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0268.jpg" alt="" width="600" height="448" /></a></p>
<p>观音娘娘亭旁边其实有一尊佛的，传说，他死后，那里的鱼会游过来吃他的肉，于是那里的海边很多鱼。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0270.jpg"><img class="alignnone size-full wp-image-2502" title="IMG_0270" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0270.jpg" alt="" width="600" height="525" /></a></p>
<p>这里没拍到那个佛像，但我们去到得时候，确实好多鱼在那里，游客喂它们吃面包。</p>
<p>这里坐船的时候我还是被偷拍了一张！</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCADD9K0N.jpg"><img class="alignnone size-full wp-image-2503" title="http_imgloadCADD9K0N" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCADD9K0N.jpg" alt="" width="670" height="445" /></a></p>
<p>脖子上的花圈是有个泰国小孩卖的。嗯，这样看起来就像游客了。</p>
<p>之后我们还参观过了泰国的的宫殿：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload.jpg"><img class="alignnone size-full wp-image-2505" title="http_imgload" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload.jpg" alt="" width="670" height="446" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAYRY4VH.jpg"><img class="alignnone size-full wp-image-2506" title="http_imgloadCAYRY4VH" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAYRY4VH.jpg" alt="" width="446" height="670" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0276.jpg"><img class="alignnone size-full wp-image-2507" title="IMG_0276" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0276.jpg" alt="" width="600" height="803" /></a></p>
<p>整个宫殿金碧辉煌的。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0279.jpg"><img class="alignnone size-full wp-image-2508" title="IMG_0279" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0279.jpg" alt="" width="600" height="448" /></a></p>
<p>他们的步兵走起路来很恶搞。</p>
<p>这里有个小分队合照：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload2.jpg"><img class="alignnone size-full wp-image-2513" title="http_imgload" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload2.jpg" alt="" width="670" height="376" /></a></p>
<p>我左边戴帽子的是我们的秘书mm,整个旅程真的很感谢她。</p>
<p>去完宫殿了，我们还去逛一些购物点</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload1.jpg"><img class="alignnone size-full wp-image-2509" title="http_imgload" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgload1.jpg" alt="" width="670" height="446" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0281.jpg"><img class="alignnone size-full wp-image-2510" title="IMG_0281" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0281.jpg" alt="" width="600" height="803" /></a></p>
<p>然后我们去了一个动物园</p>
<p>去芭提雅的时候，我们去了红灯区，那个叫震撼啊。重口味的不发了，怕和谐。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0289.jpg"><img class="alignnone size-full wp-image-2511" title="IMG_0289" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0289.jpg" alt="" width="600" height="448" /></a></p>
<p>这是一条好多好多外国人的街，各种重口味bar，可以看到好多人妖。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0290.jpg"><img class="alignnone size-full wp-image-2512" title="IMG_0290" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0290.jpg" alt="" width="600" height="448" /></a></p>
<p>上面站的人其实在跳脱衣舞的！</p>
<p>-___-!反正去那里让你毕生难忘的。</p>
<p>后来我们还到泰国最高的大楼吃自助餐：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAJUMMJK.jpg"><img class="alignnone size-full wp-image-2514" title="http_imgloadCAJUMMJK" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAJUMMJK.jpg" alt="" width="670" height="443" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAHDNEKR.jpg"><img class="alignnone size-full wp-image-2515" title="http_imgloadCAHDNEKR" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAHDNEKR.jpg" alt="" width="670" height="446" /></a></p>
<p>还去了动物园看老虎、鳄鱼表演</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0286.jpg"><img class="alignnone size-full wp-image-2516" title="IMG_0286" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0286.jpg" alt="" width="600" height="448" /></a></p>
<p>还去了海滩，沙子是白色的哦！</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0292.jpg"><img class="alignnone size-full wp-image-2517" title="IMG_0292" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0292.jpg" alt="" width="600" height="448" /></a></p>
<p>各种忘记名字的餐馆</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAU03HLW.jpg"><img class="alignnone size-full wp-image-2518" title="http_imgloadCAU03HLW" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAU03HLW.jpg" alt="" width="600" height="397" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0288.jpg"><img class="alignnone size-full wp-image-2519" title="IMG_0288" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0288.jpg" alt="" width="600" height="448" /></a></p>
<p>再后来，就是大型的人妖表演了，很有艺术感：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCA15H157.jpg"><img class="alignnone size-full wp-image-2520" title="http_imgloadCA15H157" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCA15H157.jpg" alt="" width="670" height="443" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCALPM3OD.jpg"><img class="alignnone size-full wp-image-2522" title="http_imgloadCALPM3OD" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCALPM3OD.jpg" alt="" width="670" height="443" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCALPM3OD.jpg"></a><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAJHEN3Y.jpg"><img class="alignnone size-full wp-image-2521" title="http_imgloadCAJHEN3Y" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAJHEN3Y.jpg" alt="" width="670" height="443" /></a></p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCASGCEK01.jpg"><img class="alignnone size-full wp-image-2524" title="http_imgloadCASGCEK0" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCASGCEK01.jpg" alt="" width="670" height="443" /></a></p>
<p>当然我们还看了大型的重口味表演，由于不给拍照片，这里就不放啦！</p>
<p>在旅游点经常有人偷拍（-_-!站在你面前拍照算偷拍么？）你的照片，然后做成各种东西，卖给你。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0287.jpg"><img class="alignnone size-full wp-image-2525" title="IMG_0287" src="http://xiebiji.com/wp-content/uploads/2011/08/IMG_0287.jpg" alt="" width="600" height="448" /></a></p>
<p>最后放个合影：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAV4NH5P.jpg"><img class="alignnone size-full wp-image-2526" title="http_imgloadCAV4NH5P" src="http://xiebiji.com/wp-content/uploads/2011/08/http_imgloadCAV4NH5P.jpg" alt="" width="670" height="488" /></a></p>
<p>感受嘛，就是一辈子都值得回味的记忆啦。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2011-04-02 -- <a href="http://xiebiji.com/2011/04/march-fish/" title="3月总结&#8211;我们都是鱼">3月总结&#8211;我们都是鱼</a></li><li>2009-01-23 -- <a href="http://xiebiji.com/2009/01/flashgame/" title="看我做的小孩子flash游戏">看我做的小孩子flash游戏</a></li><li>2008-08-09 -- <a href="http://xiebiji.com/2008/08/%e5%ad%a6%e6%a0%a1%e7%94%b5%e5%ad%90%e5%95%86%e5%8a%a1%e7%bd%91%e9%a1%b5%e5%b0%8f%e5%9e%8b%e6%af%94%e8%b5%9b%ef%bc%9a%e5%85%b1%e4%ba%ab%e9%80%9a%e4%bf%a1%e5%bd%95%e7%bd%91%e5%8e%9f%e5%88%9b%e4%bd%9c/" title="学校电子商务网页小型比赛：共享通信录网原创作图">学校电子商务网页小型比赛：共享通信录网原创作图</a></li><li>2008-11-07 -- <a href="http://xiebiji.com/2008/11/net/" title="突然发现很久以前做的.net个人主页还可以进去">突然发现很久以前做的.net个人主页还可以进去</a></li><li>2009-05-18 -- <a href="http://xiebiji.com/2009/05/php-%e5%ad%97%e7%ac%a6%e4%b8%b2%e7%9c%81%e7%95%a5%e5%bd%a2%e5%bc%8f%e8%be%93%e5%87%ba%e5%85%bc%e5%ae%b9%e6%89%80%e6%9c%89%e7%bc%96%e7%a0%81/" title="PHP 字符串省略形式输出[兼容所有编码]">PHP 字符串省略形式输出[兼容所有编码]</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/08/travel_in_thailand/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>最难受的时刻</title>
		<link>http://xiebiji.com/2011/08/sadtime/</link>
		<comments>http://xiebiji.com/2011/08/sadtime/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 18:08:44 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2488</guid>
		<description><![CDATA[从泰国旅游回来，带了一个带自己相片的相框回来。
现在放在桌子边，很不自觉地端量着照片里头静止的自己。
20多年来从来没有仔细观摩过这样的自己，心里想，是什么原因会让一个正处于风华正茂的小伙子，表情里充满忧郁，眼里却带着依稀的憧憬？
我没法用理性的辞藻来解释这是怎么一回事，我甚至不清楚是什么时候开始的。
也许迷茫了。
照片里的人好像很努力地在证明一个事情，但是这个事情，连他自己都不清楚是什么。
渐渐地，他即使知道自己的某些观点跟别人背道而驰，他都努力地让别人承认自己的看法。
或许他根本就没在意事情的对错，他只是想找个跟他一起错的人，这样他就心满意足了。
因为他太难受了，他怕就算他有一天大哭一场也没有人知道他为什么而哭。
最难受的时候不是伤心的时候。
人不在乎说服了多少人，只在乎跟多少人一起被说服了。
没人理解，心就死了。
更多的文章2008-11-07 -- 突然发现很久以前做的.net个人主页还可以进去2009-01-24 -- 黄金分割点，不是一般的牛！网页设计布局最简单定性思维。2008-10-20 -- 让凌驾于所有层的提示居中的一种CSS做法2009-11-11 -- 又是一年一度的光棍节！2009-12-26 -- 忘记了！！圣诞快乐！！]]></description>
			<content:encoded><![CDATA[<p>从泰国旅游回来，带了一个带自己相片的相框回来。</p>
<p>现在放在桌子边，很不自觉地端量着照片里头静止的自己。</p>
<p>20多年来从来没有仔细观摩过这样的自己，心里想，是什么原因会让一个正处于风华正茂的小伙子，表情里充满忧郁，眼里却带着依稀的憧憬？</p>
<p>我没法用理性的辞藻来解释这是怎么一回事，我甚至不清楚是什么时候开始的。</p>
<p>也许迷茫了。</p>
<p>照片里的人好像很努力地在证明一个事情，但是这个事情，连他自己都不清楚是什么。</p>
<p>渐渐地，他即使知道自己的某些观点跟别人背道而驰，他都努力地让别人承认自己的看法。</p>
<p>或许他根本就没在意事情的对错，他只是想找个跟他一起错的人，这样他就心满意足了。</p>
<p>因为他太难受了，他怕就算他有一天大哭一场也没有人知道他为什么而哭。</p>
<p>最难受的时候不是伤心的时候。</p>
<p>人不在乎说服了多少人，只在乎跟多少人一起被说服了。</p>
<p>没人理解，心就死了。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2008-12-25 -- <a href="http://xiebiji.com/2008/12/smiles-2/" title="推荐博客表情一套！很简约喔！">推荐博客表情一套！很简约喔！</a></li><li>2008-10-06 -- <a href="http://xiebiji.com/2008/10/blogroll/" title="新建了个友情链接展示与交换页面">新建了个友情链接展示与交换页面</a></li><li>2008-09-09 -- <a href="http://xiebiji.com/2008/09/%e4%b8%80%e4%b8%aa%e5%be%88%e5%a5%87%e6%80%aa%e7%9a%84js%e9%97%ae%e9%a2%98%ef%bc%81%e5%85%b3%e4%ba%8eid%e7%9a%84%e5%85%bc%e5%ae%b9/" title="一个很奇怪的JS问题！关于ID的兼容">一个很奇怪的JS问题！关于ID的兼容</a></li><li>2008-11-09 -- <a href="http://xiebiji.com/2008/11/alexa%e6%8e%92%e5%90%8d%e5%86%b2%e8%bf%9b%e5%89%8d100%e4%b8%87%ef%bc%8c%e5%8f%91%e6%96%87%e7%ab%a0%e7%95%99%e5%bf%b5%ef%bc%81/" title="ALEXA排名冲进前100万，发文章留念！">ALEXA排名冲进前100万，发文章留念！</a></li><li>2008-09-12 -- <a href="http://xiebiji.com/2008/09/%e5%93%87%e5%93%88%e7%94%a8as%e7%bc%96%e7%9a%84%e4%b8%80%e4%b8%aa%e6%b4%8b%e8%91%b1%e5%a4%b4%e8%80%81%e8%99%8e%e6%9c%baflash%ef%bc%81/" title="哇哈~用AS编的一个洋葱头老虎机FLASH！">哇哈~用AS编的一个洋葱头老虎机FLASH！</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/08/sadtime/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>7月总结</title>
		<link>http://xiebiji.com/2011/08/july/</link>
		<comments>http://xiebiji.com/2011/08/july/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 04:45:15 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2486</guid>
		<description><![CDATA[7月份是个悲喜交集的月份。
从去年7月入职到现在整整一年，即使日复一日，但我还是觉得无时无刻都改变，有被动的改变，也有主动的。
有时觉得仿佛正往一个虚无缥缈的结果前进，那最终会是怎样，无法知道，自己却有着一种懵懂的憧憬。
回顾一下最近发生的事情：
1.对我很好的导师离职；
2.工作室的师弟师妹来实习；
3.我下决心学一个以前一直想做但没做的事情；
4.认识了让我觉得自己很幸运的人；
5.旅游去了，发现自己寡言了；
6.开始觉得自己一直在犯错。
总结完以上一些事情后，胡思乱想一下：
1.我们在一个围城里头，里面的人往外跑，外面的人往里靠；围城的主人并不关注某个人的来往。
2.做得多，教的也多，谁是个全职保姆谁就悲剧了。
3.有时疯狂也就是为了了结个心愿罢了。
4.两个人相遇并袒露心声，何等难得，那是多少辈子才修来的缘。
5.世界很大，让我们感想万千，无情的词穷却让连接心灵间的铁桥锈化、堕落。
6.是错太多？还是想太多？
写完了&#8230;
更多的文章2008-09-09 -- 一个被抛弃的页面设计！2009-01-23 -- 一个可伸缩渐变圆角带边框铺阴影的table,兼容浏览器、自适应宽高的一段HTML+CSS代码。2008-08-19 -- 网页设计的原则（网页设计的理论部分）&#8211;读书笔记总结2008-08-22 -- 原创用MOOTOOLS做的超简单wp插件&#8211;最近5条日志标题（last5posts）2009-05-16 -- 之前做的一个全ajax，双语小型工作室整站]]></description>
			<content:encoded><![CDATA[<p>7月份是个悲喜交集的月份。</p>
<p>从去年7月入职到现在整整一年，即使日复一日，但我还是觉得无时无刻都改变，有被动的改变，也有主动的。</p>
<p>有时觉得仿佛正往一个虚无缥缈的结果前进，那最终会是怎样，无法知道，自己却有着一种懵懂的憧憬。</p>
<p>回顾一下最近发生的事情：</p>
<p>1.对我很好的导师离职；</p>
<p>2.工作室的师弟师妹来实习；</p>
<p>3.我下决心学一个以前一直想做但没做的事情；</p>
<p>4.认识了让我觉得自己很幸运的人；</p>
<p>5.旅游去了，发现自己寡言了；</p>
<p>6.开始觉得自己一直在犯错。</p>
<p>总结完以上一些事情后，胡思乱想一下：</p>
<p>1.我们在一个围城里头，里面的人往外跑，外面的人往里靠；围城的主人并不关注某个人的来往。</p>
<p>2.做得多，教的也多，谁是个全职保姆谁就悲剧了。</p>
<p>3.有时疯狂也就是为了了结个心愿罢了。</p>
<p>4.两个人相遇并袒露心声，何等难得，那是多少辈子才修来的缘。</p>
<p>5.世界很大，让我们感想万千，无情的词穷却让连接心灵间的铁桥锈化、堕落。</p>
<p>6.是错太多？还是想太多？</p>
<p>写完了&#8230;</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-09-27 -- <a href="http://xiebiji.com/2009/09/yslow-2-%e8%af%84%e6%b5%8b%e7%bd%91%e9%a1%b5%e6%95%88%e7%8e%87%e7%9a%84%e5%b7%a5%e5%85%b7/" title="yslow 2&#8211;评测网页效率的工具">yslow 2&#8211;评测网页效率的工具</a></li><li>2009-03-18 -- <a href="http://xiebiji.com/2009/03/font/" title="网上看到的几款我很喜欢的字体设计">网上看到的几款我很喜欢的字体设计</a></li><li>2008-10-22 -- <a href="http://xiebiji.com/2008/10/ff/" title="有些事情无法避免，就如扎克斯与爱丽丝">有些事情无法避免，就如扎克斯与爱丽丝</a></li><li>2011-12-10 -- <a href="http://xiebiji.com/2011/12/11%e6%9c%88%e6%80%bb%e7%bb%93-%e6%98%af%e5%a5%bd%e7%9a%84%ef%bc%8c%e5%81%9a%ef%bc%8c%e5%b0%b1%e5%af%b9%e4%ba%86/" title="11月总结 &#8212; 是好的，做，就对了">11月总结 &#8212; 是好的，做，就对了</a></li><li>2009-08-05 -- <a href="http://xiebiji.com/2009/08/%e8%bf%99%e5%a4%a9%e5%88%86%e4%b8%8d%e5%a4%9f%e6%9e%9c%e7%84%b6%e6%98%af%e4%b8%aa%e9%97%ae%e9%a2%98/" title="这&#8230;天分不够果然是个问题">这&#8230;天分不够果然是个问题</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/08/july/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>6月总结&#8212;事情坚持就会是好事</title>
		<link>http://xiebiji.com/2011/07/june/</link>
		<comments>http://xiebiji.com/2011/07/june/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 16:40:04 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2483</guid>
		<description><![CDATA[慢慢的，好像对写日志有点抗拒了。
但我能肯定的是，不管写的是什么文字，写的有没用，只要坚持写下去，或多或少总会对自己有用。
于是我还是需要坚持。
我们都很浮躁，这是正常的，年轻人的通病。
为什么浮躁？
那只是因为少了一份坚持的心。
对什么事什么人做了些什么，只要知道初衷是好的，预知的结果也是好的，剩下的只是中间坚持的过程。
我懂这个道理的，易说不易做，大道理大家都懂，真正做到的没多少位。
别人指出或自己反省都能使我们自己轻而易举地看到自己的不足。
但人活久了对自己的缺点或坏习惯不是视而不见，而是力不从心，这种“爱莫能助”确实无奈。
不是没有正确的觉悟，只是少了份至死不渝的决心。
好的事情，初衷只是卖关子，结果只是作附属，歌颂的应该是不懈的过程。
更多的文章2009-09-23 -- 兼容ie6的元素位置fixed的方法2009-02-01 -- 或许“乐笑四年终日谈”比不上“寒窗一季半席话”2011-01-23 -- 我给你说个小秘密2008-12-21 -- 空间奇慢，想换个新空间，路过的朋友推荐一下？冬至快乐！2008-08-26 -- 环保的创意设计，漂亮环保袋！]]></description>
			<content:encoded><![CDATA[<p>慢慢的，好像对写日志有点抗拒了。</p>
<p>但我能肯定的是，不管写的是什么文字，写的有没用，只要坚持写下去，或多或少总会对自己有用。</p>
<p>于是我还是需要坚持。</p>
<p>我们都很浮躁，这是正常的，年轻人的通病。</p>
<p>为什么浮躁？</p>
<p>那只是因为少了一份坚持的心。</p>
<p>对什么事什么人做了些什么，只要知道初衷是好的，预知的结果也是好的，剩下的只是中间坚持的过程。</p>
<p>我懂这个道理的，易说不易做，大道理大家都懂，真正做到的没多少位。</p>
<p>别人指出或自己反省都能使我们自己轻而易举地看到自己的不足。</p>
<p>但人活久了对自己的缺点或坏习惯不是视而不见，而是力不从心，这种“爱莫能助”确实无奈。</p>
<p>不是没有正确的觉悟，只是少了份至死不渝的决心。</p>
<p>好的事情，初衷只是卖关子，结果只是作附属，歌颂的应该是不懈的过程。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-09-19 -- <a href="http://xiebiji.com/2009/09/qq%e7%9a%84%e5%9f%9f%e5%90%8d%e9%82%ae%e7%ae%b1%e5%a4%aa%e6%96%b9%e4%be%bf%e4%ba%86%ef%bc%81/" title="qq的域名邮箱太方便了！">qq的域名邮箱太方便了！</a></li><li>2008-11-05 -- <a href="http://xiebiji.com/2008/11/tuxing/" title="最近画了两个小图形">最近画了两个小图形</a></li><li>2009-06-24 -- <a href="http://xiebiji.com/2009/06/%e8%bf%91%e6%97%a5%e8%80%83%e8%af%95%ef%bc%8c%e6%96%87%e7%ab%a0%e6%9a%82%e5%81%9c%e6%9b%b4%e6%96%b0/" title="近日考试，文章暂停更新">近日考试，文章暂停更新</a></li><li>2008-09-04 -- <a href="http://xiebiji.com/2008/09/%e6%9c%80%e8%bf%91%e5%81%9a%e5%88%87%e5%89%b2%e5%8f%91%e7%8e%b0%e7%9a%84cssfloat%e5%85%bc%e5%ae%b9%e9%97%ae%e9%a2%98/" title="最近做切割发现的css,float兼容问题">最近做切割发现的css,float兼容问题</a></li><li>2009-12-26 -- <a href="http://xiebiji.com/2009/12/%e5%bf%98%e8%ae%b0%e4%ba%86%ef%bc%81%ef%bc%81%e5%9c%a3%e8%af%9e%e5%bf%ab%e4%b9%90%ef%bc%81%ef%bc%81/" title="忘记了！！圣诞快乐！！">忘记了！！圣诞快乐！！</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/07/june/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>5月总结</title>
		<link>http://xiebiji.com/2011/06/may/</link>
		<comments>http://xiebiji.com/2011/06/may/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 15:31:27 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2480</guid>
		<description><![CDATA[各种露营，各种搬家，各种周末恐惧症，各种懒洋洋。。。5月是个不着调的月份，一笔带过~
更多的文章2008-08-10 -- flash与js 互相调用2009-03-10 -- 推荐一个js表单验证类，很实用2010-03-21 -- 一群疯了但奇妙的家伙2008-12-18 -- IE ajax 未知运行错误!解决方法！2009-02-25 -- 推荐一个前端设计者的博客]]></description>
			<content:encoded><![CDATA[<p>各种露营，各种搬家，各种周末恐惧症，各种懒洋洋。。。5月是个不着调的月份，一笔带过~</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-04-14 -- <a href="http://xiebiji.com/2009/04/%e5%a5%87%e6%80%9d%e5%a6%99%e6%83%b3%ef%bc%9f%ef%bc%9f/" title="奇思妙想？？">奇思妙想？？</a></li><li>2009-06-17 -- <a href="http://xiebiji.com/2009/06/mootools-ajax-json/" title="mootools中文实例诠释&#8211;1.2版AJAX,JSON运用">mootools中文实例诠释&#8211;1.2版AJAX,JSON运用</a></li><li>2008-08-11 -- <a href="http://xiebiji.com/2008/08/ps3%e5%90%88%e9%87%91%e8%a3%85%e5%a4%874%e7%8e%a9%e5%90%8e%e6%84%9f%ef%bc%81/" title="ps3合金装备4玩后感！">ps3合金装备4玩后感！</a></li><li>2011-01-29 -- <a href="http://xiebiji.com/2011/01/mywords/" title="写给自己的格言">写给自己的格言</a></li><li>2010-01-27 -- <a href="http://xiebiji.com/2010/01/two-people/" title="回到最初">回到最初</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/06/may/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canvas滤镜预研</title>
		<link>http://xiebiji.com/2011/06/canvas%e6%bb%a4%e9%95%9c%e9%a2%84%e7%a0%94/</link>
		<comments>http://xiebiji.com/2011/06/canvas%e6%bb%a4%e9%95%9c%e9%a2%84%e7%a0%94/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 02:31:26 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2461</guid>
		<description><![CDATA[Canvas滤镜预研
 
 最近小花对Q拍的滤镜效果很感兴趣，折腾了一下，其实用canvas也可以模拟这些效果。 
先看个demo:

最佳体验配置：pc用chrome或safari打开或ipad/ipad2/iphone4打开这里 。
纯web图形处理与native app图形处理的区别，这里就不阐述了。欢迎大家讨论。
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
以下为全文：
 
HTML5 的canvas相信大家早有听闻，不支持flash的IOS设备要对图形处理可以用它来实现。canvas API内容挺多的，以下只是抽取部分属性和方法来阐述，抛砖引玉一下。
本文的主要内容是： canvas的简单图形处理，其中包括编码读写、像素级处理以及简单用法。这些操作都是在客户端处理的。
第一. 要进行图片处理，首先考虑的应该是编码的读写。
 
1. 来看一下canvas是怎样读取图片。

这里要留意了，有些同学开始玩canvas的时候死活读不进图片，原因在于：你得首先让图片加载进来，因为程序跑得比图片加载快。
这里有必要了解一下，canvas画布的概念，简单可以描述为： 用canvas.getContext（“2d”）方法来获取一个2d画布，画布有自身的方法。用这些方法就可以在画布上面乱涂拉！
其中drawImage是用来把图片“涂”进来的,它有3个函数原型

关于这三个方法，看了下面这个图就会明白：

其实看起来还是有点纠结，没关系，我们这里重点在于第一句，因为本来就是想着图片处理，那把canvas的宽度设成图片的宽高，然后把图片读进来放在canvas画布ctx的左上角就OK拉。说白了，就是读取图片的时候就是： 做一个跟图片看起来一模一样的canvas。
这样，很简单就把图片读进来了！Amazing！
2. canvas怎样输出编码？
当你用画布的方法乱涂乱画之后，用以下方法可以很简单输出图片编码：

这方法是canvas对象的，不是画布的。type可以在image/png，image/jpeg,image/svg+xml等 MIME类型中选择。如果是image/jpeg，可以有第二个参数，如果第二个参数的值在0-1之间，则表示JPEG的质量等级，否则使用浏览器内置默认质量等级。
以下以” image/png”为例，可以输出一段这样的字符串：
 
这是一段灰常灰常长的字符串！他叫Data URI。

注意.假如开始用drawImage“涂”进来的图片的src地址是跨域的（例如，网页放在a.com而图片的地址是b.com/c.jpg）,这样的话，这个toDataUrl方法会报错。 
那肿么办呢？蛋定，其实在需要处理这种图片时，先把它放到自己服务器转成同域就好了（可线下一起研究转换方法）。
这样，很简单就把图片输出来了！Unbelievable！
第二. 什么是canvas的像素级处理呢？
 
大家可以先看抽离出来的demo:


1. 图像的像素点是怎么存储的？

在进行图像处理前，得先了解一下图像是怎么存储每一个像素点的数据的。
看个图先：

玩css3的同学知道一个新的颜色定义方式&#8212;rgba,这里说的跟这个很像。
简单的像素点存储其实把每个像素点用四个数字来存储，分别是R（红）、G（绿）、B（蓝）、A（不透明度），然后这里的A值跟不透明度存在一个关系，60%=153/255，即不透明度=A值/255。
通过改变每个像素点的这四个维度，我们可以达到改变纯度，透明度，色相，亮度等所有效果，这是滤镜的基础原理，玩ps的盆友也许更熟悉这块。

2. Canvas怎么读写所有像素点数据？

a)     读取

画布的方法：getImageData可以获取指定范围内的像素点数据。参数x、y为起始位置，w、h为范围宽高。
该方法将返回形如以下的对象：

上图对应的是存储两个像素点数据的对象，对象中含有一个叫data的数组，其每四个键值对，存储一个像素点的数据，像素点从左到右排列。
b)     写入

画布的方法：putImageData可以把指定像素点数据对象（getImageData返回的对象），填充到指定位置，x、y为开始填充点。
第三. 用法？
了解上述原理和方法之后，只要遍历取出的像素点对象，再按指定的算法来改变每个像素点的数据，再把对象重绘到画布。

然后canvas对象来输出编码（第一点），就能达到滤镜效果了。

效果的好坏主要取决于算法的好坏。
需要提醒的是，canvas的像素级处理比较耗费资源，但是对于宽高不是太大的图片，速度还是可以接受的。
这里顺带介绍一下QST库里头关于这个滤镜效果插件的简单使用：
其中preloaded为预载效果数量（由于对于某个图片，效果被渲染后会自动缓存在js对象里头，而执行渲染时需要时间，所以需要预载部分效果）。其他更详细参数，有兴趣的同学可线下交流。
更多的文章2008-12-22 -- 【mootools中文实例诠释】Accordion类（折叠菜单）的使用2010-04-17 -- FLEA中二叉树数组的遍历输出2008-12-19 -- 六级来啦！！！我有一天的时间复习！2008-11-16 -- 兼容FF和IE的html传递参数给swf的方法2009-11-11 -- 又是一年一度的光棍节！]]></description>
			<content:encoded><![CDATA[<p><b>Canvas</b><b>滤镜预研</b></p>
<p><b> </b></p>
<p><b> </b><b>最近小花对Q拍的滤镜效果很感兴趣，折腾了一下，其实用canvas也可以模拟这些效果。 </b></p>
<p><b>先看个demo:</b></p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/1.jpg"><img class="alignnone size-full wp-image-2462" title="1" src="http://xiebiji.com/wp-content/uploads/2011/06/1.jpg" alt="" width="553" height="421" /></a></b></p>
<p>最佳体验配置：pc用chrome或safari打开或ipad/ipad2/iphone4打开<a href="http://xiebiji.com/works/QST/examples_new/imgCutMod/">这里 </a>。</p>
<p>纯web图形处理与native app图形处理的区别，这里就不阐述了。欢迎大家讨论。</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p><b>以下为全文：</b></p>
<p><b> </b></p>
<p>HTML5 的canvas相信大家早有听闻，不支持flash的IOS设备要对图形处理可以用它来实现。canvas API内容挺多的，以下只是抽取部分属性和方法来阐述，抛砖引玉一下。</p>
<p>本文的主要内容是： canvas的简单图形处理，其中包括<b>编码读写</b>、<b>像素级处理以及简单用法</b>。这些操作都是在客户端处理的。</p>
<p><b>第一. </b><b>要进行图片处理，首先考虑的应该是编码的读写。</b></p>
<p><b> </b></p>
<p><b>1. </b><b>来看一下canvas是怎样读取图片。</b></p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/2.jpg"><img class="alignnone size-full wp-image-2463" title="2" src="http://xiebiji.com/wp-content/uploads/2011/06/2.jpg" alt="" width="499" height="211" /></a></b></p>
<p>这里要留意了，有些同学开始玩canvas的时候死活读不进图片，原因在于：你得首先让图片加载进来，因为程序跑得比图片加载快。</p>
<p>这里有必要了解一下，canvas画布的概念，简单可以描述为： 用canvas.getContext（“2d”）方法来获取一个2d画布，画布有自身的方法。用这些方法就可以在画布上面乱涂拉！</p>
<p>其中drawImage是用来把图片“涂”进来的,它有3个函数原型</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/06/3.jpg"><img class="alignnone size-full wp-image-2464" title="3" src="http://xiebiji.com/wp-content/uploads/2011/06/3.jpg" alt="" width="500" height="112" /></a></p>
<p>关于这三个方法，看了下面这个图就会明白：</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/4.jpg"><img class="alignnone size-full wp-image-2463" title="4" src="http://xiebiji.com/wp-content/uploads/2011/06/4.jpg" alt="" /></a></b></p>
<p>其实看起来还是有点纠结，没关系，我们这里重点在于第一句，因为本来就是想着图片处理，那把canvas的宽度设成图片的宽高，然后把图片读进来放在canvas画布ctx的左上角就OK拉。说白了，就是读取图片的时候就是： 做一个跟图片看起来一模一样的canvas。</p>
<p>这样，很简单就把图片读进来了！Amazing！</p>
<p><b>2. canvas</b><b>怎样输出编码？</b></p>
<p>当你用画布的方法乱涂乱画之后，用以下方法可以很简单输出图片编码：</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/5.jpg"><img class="alignnone size-full wp-image-2463" title="5" src="http://xiebiji.com/wp-content/uploads/2011/06/5.jpg" alt="" /></a></b></p>
<p>这方法是canvas对象的，不是画布的。type可以在image/png，image/jpeg,image/svg+xml等 MIME类型中选择。如果是image/jpeg，可以有第二个参数，如果第二个参数的值在0-1之间，则表示JPEG的质量等级，否则使用浏览器内置默认质量等级。</p>
<p>以下以” image/png”为例，可以输出一段这样的字符串：</p>
<p><b> </b></p>
<p>这是一段灰常灰常长的字符串！<b>他叫</b><a href="http://www.cssforest.org/blog/index.php?id=152"><b>Data URI</b></a><b>。</b></p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/6.jpg"><img class="alignnone size-full wp-image-2463" title="6" src="http://xiebiji.com/wp-content/uploads/2011/06/6.jpg" alt="" /></a></b></p>
<p><b>注意.</b>假如开始用drawImage“涂”进来的图片的src地址是跨域的（例如，网页放在a.com而图片的地址是b.com/c.jpg）,这样的话，这个toDataUrl方法会报错。<b> </b></p>
<p>那肿么办呢？蛋定，其实在需要处理这种图片时，先把它放到自己服务器转成同域就好了（可线下一起研究转换方法）。</p>
<p>这样，很简单就把图片输出来了！Unbelievable！</p>
<p><b>第二. </b><b>什么是canvas的像素级处理呢？</b></p>
<p><b> </b></p>
<p>大家可以先看抽离出来的<a href="http://xiebiji.com/works/QST/examples_new/imgEffectMod/">demo</a>:</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/7.jpg"><img class="alignnone size-full wp-image-2463" title="7" src="http://xiebiji.com/wp-content/uploads/2011/06/7.jpg" alt="" /></a></b></p>
<ol>
<li><b>1. </b><b>图像的像素点是怎么存储的？</b></li>
</ol>
<p>在进行图像处理前，得先了解一下图像是怎么存储每一个像素点的数据的。</p>
<p>看个图先：</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/8.jpg"><img class="alignnone size-full wp-image-2463" title="8" src="http://xiebiji.com/wp-content/uploads/2011/06/8.jpg" alt="" /></a></b></p>
<p>玩css3的同学知道一个新的颜色定义方式&#8212;rgba,这里说的跟这个很像。</p>
<p>简单的像素点存储其实把每个像素点用四个数字来存储，分别是R（红）、G（绿）、B（蓝）、A（不透明度），然后这里的A值跟不透明度存在一个关系，60%=153/255，即不透明度=A值/255。</p>
<p>通过改变每个像素点的这四个维度，我们可以达到改变纯度，透明度，色相，亮度等所有效果，这是滤镜的基础原理，玩ps的盆友也许更熟悉这块。</p>
<ol>
<li><b>2. </b><b>Canvas</b><b>怎么读写所有像素点数据？</b></li>
</ol>
<p>a)     读取</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/9.jpg"><img class="alignnone size-full wp-image-2463" title="9" src="http://xiebiji.com/wp-content/uploads/2011/06/9.jpg" alt="" /></a></b></p>
<p>画布的方法：getImageData可以获取指定范围内的像素点数据。参数x、y为起始位置，w、h为范围宽高。</p>
<p>该方法将返回形如以下的对象：</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/10.jpg"><img class="alignnone size-full wp-image-2463" title="10" src="http://xiebiji.com/wp-content/uploads/2011/06/10.jpg" alt="" /></a></b></p>
<p>上图对应的是存储两个像素点数据的对象，对象中含有一个叫data的数组，其每四个键值对，存储一个像素点的数据，像素点从左到右排列。</p>
<p>b)     写入</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/11.jpg"><img class="alignnone size-full wp-image-2463" title="11" src="http://xiebiji.com/wp-content/uploads/2011/06/11.jpg" alt="" /></a></b></p>
<p>画布的方法：putImageData可以把指定像素点数据对象（getImageData返回的对象），填充到指定位置，x、y为开始填充点。</p>
<p><b>第三. </b><b>用法</b><b>？</b></p>
<p>了解上述原理和方法之后，只要遍历取出的像素点对象，再按指定的算法来改变每个像素点的数据，再把对象重绘到画布。</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/12.jpg"><img class="alignnone size-full wp-image-2463" title="12" src="http://xiebiji.com/wp-content/uploads/2011/06/12.jpg" alt="" /></a></b></p>
<p>然后canvas对象来输出编码（第一点），就能达到滤镜效果了。</p>
<p><b><a href="http://xiebiji.com/wp-content/uploads/2011/06/5.jpg"><img class="alignnone size-full wp-image-2463" title="5" src="http://xiebiji.com/wp-content/uploads/2011/06/5.jpg" alt="" /></a></b></p>
<p>效果的好坏主要取决于算法的好坏。</p>
<p>需要提醒的是，canvas的像素级处理比较耗费资源，但是对于宽高不是太大的图片，速度还是可以接受的。</p>
<p>这里顺带介绍一下QST库里头关于这个滤镜效果插件的简单使用：</p>
<p>其中preloaded为预载效果数量（由于对于某个图片，效果被渲染后会自动缓存在js对象里头，而执行渲染时需要时间，所以需要预载部分效果）。其他更详细参数，有兴趣的同学可线下交流。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2011-11-19 -- <a href="http://xiebiji.com/2011/11/october_summary/" title="10月总结 &#8212; 得到越多，就要明白得不到或失去时有多悲痛。">10月总结 &#8212; 得到越多，就要明白得不到或失去时有多悲痛。</a></li><li>2008-08-10 -- <a href="http://xiebiji.com/2008/08/wp%e4%b8%80%e4%b8%aa%e5%8a%9f%e8%83%bd%e7%9a%84%e5%ae%9e%e7%8e%b0%ef%bc%9a%e5%85%b3%e4%ba%8e%e6%91%98%e8%a6%81%e8%b7%9f%e5%88%86%e9%a1%b5%e7%9a%84%e5%8a%9f%e8%83%bd%e5%ae%9e%e7%8e%b0/" title="WP一个功能的实现：关于摘要跟分页的功能实现(1)">WP一个功能的实现：关于摘要跟分页的功能实现(1)</a></li><li>2008-12-25 -- <a href="http://xiebiji.com/2008/12/smiles-2/" title="推荐博客表情一套！很简约喔！">推荐博客表情一套！很简约喔！</a></li><li>2009-09-08 -- <a href="http://xiebiji.com/2009/09/50%e4%b8%aa%e6%af%8f%e4%b8%aa%e8%ae%be%e8%ae%a1%e8%80%85%e8%a6%81%e7%9c%8b%e7%9a%84aiillustrator%e6%95%99%e7%a8%8b/" title="50个每个设计者要看的AI(illustrator)教程">50个每个设计者要看的AI(illustrator)教程</a></li><li>2009-06-17 -- <a href="http://xiebiji.com/2009/06/mootools-ajax-json/" title="mootools中文实例诠释&#8211;1.2版AJAX,JSON运用">mootools中文实例诠释&#8211;1.2版AJAX,JSON运用</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/06/canvas%e6%bb%a4%e9%95%9c%e9%a2%84%e7%a0%94/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4月总结&#8212;一年一变</title>
		<link>http://xiebiji.com/2011/05/summary/</link>
		<comments>http://xiebiji.com/2011/05/summary/#comments</comments>
		<pubDate>Mon, 02 May 2011 13:51:06 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活总结]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2438</guid>
		<description><![CDATA[渐渐地，觉得外面的世界很大很大很花很花，但是我却越来越是一个人。
4月是一个难忘的月份。
每年的这个时候，新来的同事特别的多。想一下上一年的自己，再对比现在的自己，感觉生活就像一个个轮回，一年一变，我看起来越来越傻，也许说越来越会装B了。
渐渐地觉得谈话没以前放得开，渐渐地感觉人没读书的时候聪明了。
工作是一个恶魔。吞噬了多少欢乐的思绪。当年三个同班同学来到这个大公司，如今只有我一个还在那里，一直觉得作为一个大公司的员工，心里很骄傲的，但是当周围的朋友一个个离去的时候，霎时间却觉得自己挺悲哀的。
一个会跟自己说心事的领导走了，一个大学年代一起努力为梦想奋斗的同学也走了，另一个最想他来公司的好朋友总无法进来。
有时候觉得自己真的挺无能的，但是却有着一种没办法解释的冲劲。
尽管不愁穿不愁吃，生活依然会烦恼。我总无法肆无忌惮地挥霍这昂贵的青春，这可恶的节假日，我越来越是没感觉了。就像我微博里头说的：

我清楚地知道这是生活缺了一种寄托了。
听人常说拥抱变化，但是那是有基础的，那需要一种精神上的挂念。
就好像读大学的时候，我们都知道要先找一份好工作，因为那是对家人的一种回报。
这算是一种追求。
而到工作后，人追求也许就变了，我们变得想独立门户，即使恋家，却又有一种想独立的思绪。
喜欢拥抱变化，也许只是因为你觉得这样会对另外一个人或者一群人更好而已，而往往不是只是在考虑自己个人，你为自己考虑的已经很多，多得你自己都觉得已经不耐烦了。
人最大的自私其实不是对自己的好，而是强加于别人的爱。这却是一种动力。
心无依归，何以成大器啊。
更多的文章2009-04-26 -- 【教程】LOGO是这样出来的2008-08-10 -- flash与js 互相调用2008-10-31 -- AJAX[PHP,JS,JSON]的一个应用例子2009-05-09 -- 可爱的飞机稿2008-12-24 -- 【mootools中文实例诠释】Ajax类的简单使用 ]]></description>
			<content:encoded><![CDATA[<p>渐渐地，觉得外面的世界很大很大很花很花，但是我却越来越是一个人。</p>
<p>4月是一个难忘的月份。</p>
<p>每年的这个时候，新来的同事特别的多。想一下上一年的自己，再对比现在的自己，感觉生活就像一个个轮回，一年一变，我看起来越来越傻，也许说越来越会装B了。</p>
<p>渐渐地觉得谈话没以前放得开，渐渐地感觉人没读书的时候聪明了。</p>
<p>工作是一个恶魔。吞噬了多少欢乐的思绪。当年三个同班同学来到这个大公司，如今只有我一个还在那里，一直觉得作为一个大公司的员工，心里很骄傲的，但是当周围的朋友一个个离去的时候，霎时间却觉得自己挺悲哀的。</p>
<p>一个会跟自己说心事的领导走了，一个大学年代一起努力为梦想奋斗的同学也走了，另一个最想他来公司的好朋友总无法进来。</p>
<p>有时候觉得自己真的挺无能的，但是却有着一种没办法解释的冲劲。</p>
<p>尽管不愁穿不愁吃，生活依然会烦恼。我总无法肆无忌惮地挥霍这昂贵的青春，这可恶的节假日，我越来越是没感觉了。就像我微博里头说的：</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/05/1.jpg"><img class="alignnone size-full wp-image-2439" style="border: 1px solid #ebebeb;" title="我的爱要给谁" src="http://xiebiji.com/wp-content/uploads/2011/05/1.jpg" alt="" width="547" height="324" /></a></p>
<p>我清楚地知道这是生活缺了一种寄托了。</p>
<p>听人常说拥抱变化，但是那是有基础的，那需要一种精神上的挂念。</p>
<p>就好像读大学的时候，我们都知道要先找一份好工作，因为那是对家人的一种回报。</p>
<p>这算是一种追求。</p>
<p>而到工作后，人追求也许就变了，我们变得想独立门户，即使恋家，却又有一种想独立的思绪。</p>
<p>喜欢拥抱变化，也许只是因为你觉得这样会对另外一个人或者一群人更好而已，而往往不是只是在考虑自己个人，你为自己考虑的已经很多，多得你自己都觉得已经不耐烦了。</p>
<p>人最大的自私其实不是对自己的好，而是强加于别人的爱。这却是一种动力。</p>
<p>心无依归，何以成大器啊。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-03-19 -- <a href="http://xiebiji.com/2009/03/dangdang/" title="再次对当当表示不满！">再次对当当表示不满！</a></li><li>2011-10-23 -- <a href="http://xiebiji.com/2011/10/november_summary/" title="9月总结">9月总结</a></li><li>2011-12-10 -- <a href="http://xiebiji.com/2011/12/11%e6%9c%88%e6%80%bb%e7%bb%93-%e6%98%af%e5%a5%bd%e7%9a%84%ef%bc%8c%e5%81%9a%ef%bc%8c%e5%b0%b1%e5%af%b9%e4%ba%86/" title="11月总结 &#8212; 是好的，做，就对了">11月总结 &#8212; 是好的，做，就对了</a></li><li>2009-12-01 -- <a href="http://xiebiji.com/2009/12/iefirefoxevent/" title="ie和firefox中的事件处理">ie和firefox中的事件处理</a></li><li>2008-09-25 -- <a href="http://xiebiji.com/2008/09/3css/" title="在网页中嵌入css的三种方法 ">在网页中嵌入css的三种方法 </a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/05/summary/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>3月总结&#8211;我们都是鱼</title>
		<link>http://xiebiji.com/2011/04/march-fish/</link>
		<comments>http://xiebiji.com/2011/04/march-fish/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 02:18:44 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活总结]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2431</guid>
		<description><![CDATA[今日复习了一下鲢鱼效应（注.不了解的同学可以google一下^_^）,周围工作的人中有很多就像沙丁鱼一样安于现状。你也没法要求他们如鲢鱼一样，因为每个人有不一样的追求以及负担。

3月份过去后，我发现好多跟我同期的毕业生都欣然从墙内跳到墙外，毕业生是一群不安分的群体，那为什么企业还是如此疯狂地招募毕业生？
应届的毕业生在IT界里头(应该还包括一些别的行业)很大程度充当了鲢鱼群这种角色，这群人最富有激情与冲劲，很容易给老员工带来一种危机感，从而提升了整体员工的积极性，这也是大企业为什么在校园招聘上加大力度的其中一个原因吧，毕竟新生的力量总让人觉得恐惧。
刚毕业的同学，弱弱地说一句，你们的激情是最有力的武器，未毕业就安于现状那是自断前程。
再联想到切身的方面，工作还不到一年的我，是该以什么形态来面对这种形式呢？
明确一点：起码我不是一条沙丁鱼，但是即使我是一条鲢鱼，我也会有退化成沙丁鱼的必经阶段。
一刹那的光辉不代表永恒，但这个“一刹那”是相对的，相对于那部分围观的人。
当你在发亮的时候，只要没有别的发光体在跟你作对比，别人看到的不是你有多亮，而是没人比你亮；而当群众的新宠出现时，欣然脱离这个群体，选择另一个群体，何乐而不为？
这跟“坚持”并不矛盾。
谁都想被重视，被重视而放弃那是脑缺钙，不被重视而坚持那是自虐。
当然，前提是，必需有选择的机会。
选择的机会就是所谓的差距，差距等于实力加机遇。机遇不可强求，实力是可以的，而实力的提升看起来更需要深谋远虑。
倘若正值疯狂，就让自己再疯狂一会，谁年轻的时候不曾爱上一个傻逼。
这只是在机遇来临前，为自己实力的提升做点贡献罢了。
然后，
成为一条靠青春吃饭的鲢鱼是悲剧的，从鲢鱼变成一条沙丁鱼老大才是最终目标，你们懂的。
更多的文章2008-08-27 -- 终于完成任务了！三下乡专题页！2011-01-30 -- textarea获取选中字符位置2008-08-16 -- 想你的FLASH符合W3C标准？用swfobject.js吧！2009-09-27 -- 【Mootools 1.2中文实例诠释】Fx.Scroll扩展类应用&#8211;带动画效果的锚点跳转2010-04-17 -- FLEA中二叉树数组的遍历输出]]></description>
			<content:encoded><![CDATA[<p>今日复习了一下鲢鱼效应（注.不了解的同学可以google一下^_^）,周围工作的人中有很多就像沙丁鱼一样安于现状。你也没法要求他们如鲢鱼一样，因为每个人有不一样的追求以及负担。</p>
<p><a href="http://xiebiji.com/wp-content/uploads/2011/04/b_1270576847658.png"><img class="alignnone size-full wp-image-2435" title="fish" src="http://xiebiji.com/wp-content/uploads/2011/04/b_1270576847658.png" alt="" width="420" height="280" /></a></p>
<p>3月份过去后，我发现好多跟我同期的毕业生都欣然从墙内跳到墙外，毕业生是一群不安分的群体，那为什么企业还是如此疯狂地招募毕业生？</p>
<p>应届的毕业生在IT界里头(应该还包括一些别的行业)很大程度充当了鲢鱼群这种角色，这群人最富有激情与冲劲，很容易给老员工带来一种危机感，从而提升了整体员工的积极性，这也是大企业为什么在校园招聘上加大力度的其中一个原因吧，毕竟新生的力量总让人觉得恐惧。</p>
<p>刚毕业的同学，弱弱地说一句，你们的激情是最有力的武器，未毕业就安于现状那是自断前程。</p>
<p>再联想到切身的方面，工作还不到一年的我，是该以什么形态来面对这种形式呢？</p>
<p>明确一点：起码我不是一条沙丁鱼，但是即使我是一条鲢鱼，我也会有退化成沙丁鱼的必经阶段。</p>
<p>一刹那的光辉不代表永恒，但这个“一刹那”是相对的，相对于那部分围观的人。</p>
<p>当你在发亮的时候，只要没有别的发光体在跟你作对比，别人看到的不是你有多亮，而是没人比你亮；而当群众的新宠出现时，欣然脱离这个群体，选择另一个群体，何乐而不为？</p>
<p>这跟“坚持”并不矛盾。</p>
<p>谁都想被重视，被重视而放弃那是脑缺钙，不被重视而坚持那是自虐。</p>
<p>当然，前提是，必需有选择的机会。</p>
<p>选择的机会就是所谓的差距，差距等于实力加机遇。机遇不可强求，实力是可以的，而实力的提升看起来更需要深谋远虑。</p>
<p>倘若正值疯狂，就让自己再疯狂一会，谁年轻的时候不曾爱上一个傻逼。</p>
<p>这只是在机遇来临前，为自己实力的提升做点贡献罢了。</p>
<p>然后，</p>
<p>成为一条靠青春吃饭的鲢鱼是悲剧的，从鲢鱼变成一条沙丁鱼老大才是最终目标，你们懂的。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2008-10-31 -- <a href="http://xiebiji.com/2008/10/json/" title="JSON 在JS和PHP中的应用">JSON 在JS和PHP中的应用</a></li><li>2009-05-19 -- <a href="http://xiebiji.com/2009/05/%e7%94%b7%e7%9a%84%e5%8f%a3%e7%a1%ac%e5%8d%b4%e5%bf%83%e8%bd%af%ef%bc%8c%e5%a5%b3%e7%9a%84%e5%8f%a3%e8%bd%af%e4%b9%9f%e5%bf%83%e8%bd%af/" title="男的口硬却心软，女的口软也心软">男的口硬却心软，女的口软也心软</a></li><li>2010-09-04 -- <a href="http://xiebiji.com/2010/09/auguest-2/" title="月经-8月">月经-8月</a></li><li>2008-12-25 -- <a href="http://xiebiji.com/2008/12/smiles-2/" title="推荐博客表情一套！很简约喔！">推荐博客表情一套！很简约喔！</a></li><li>2009-10-20 -- <a href="http://xiebiji.com/2009/10/logo-3/" title="画了个飞机logo，既然不喜欢我直接改造">画了个飞机logo，既然不喜欢我直接改造</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/04/march-fish/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>事件DOMContentLoaded与load的区别</title>
		<link>http://xiebiji.com/2011/03/load/</link>
		<comments>http://xiebiji.com/2011/03/load/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 04:54:32 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[DOMContentLoaded]]></category>
		<category><![CDATA[load]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2421</guid>
		<description><![CDATA[先看这两句代码：
window.addEventListener(&#8216;load&#8217;, loaded, false);
document.addEventListener(&#8216;DOMContentLoaded&#8217;, loaded, false);
问题回顾：
这问题可把我郁闷死了，网上找的一个demo里头，他把样式直接用style内联（这种引进方式是dom方式）进来，然后用DOMContentLoaded来处理js，本来是没问题的。
但是当你把内联的样式写在一个外联的样式文件里头然后再进来的时候，问题就出现了。
什么原因？
DOMContentLoaded在外联样式加载前（dom加载完后）就触发了，外联的样式还没来得及渲染dom，这样导致DOMContentLoaded捕获的状态是外联样式渲染前的状态。
改变窗口大小可以重新触发样式的渲染，所以会形成一个假象：
页面进来的时候某个被样式定义过高度的元素的offsetHeight在你改变一下窗口（或者别的可以引起reflow的操作）时，js获取的这个offsetHeight居然不一样的，而在我们看来页面进来时跟窗口改变后，元素本身就没发生高度变化。
总结：
load事件是在页面所有元素都加载完后触发；
DOMContentLoaded，它是指dom tree加载完就触发。这个事件要小心使用，当然它是个强大的事件，起码用上它在某一层面上防止了页面加载被堵塞。
更多的文章2009-09-28 -- DOM树里面某个元素各个位置属性的图文描述2009-01-24 -- 黄金分割点，不是一般的牛！网页设计布局最简单定性思维。2010-10-20 -- 自创js类与继承的实现2008-08-17 -- 漂亮的一套黑白图标，分享了2009-05-18 -- PHP 字符串省略形式输出[兼容所有编码]]]></description>
			<content:encoded><![CDATA[<p>先看这两句代码：</p>
<p>window.addEventListener(&#8216;load&#8217;, loaded, false);</p>
<p>document.addEventListener(&#8216;DOMContentLoaded&#8217;, loaded, false);</p>
<p><strong>问题回顾：</strong></p>
<p>这问题可把我郁闷死了，网上找的一个demo里头，他把样式直接用style内联（这种引进方式是dom方式）进来，然后用DOMContentLoaded来处理js，本来是没问题的。</p>
<p>但是当你把内联的样式写在一个外联的样式文件里头然后再进来的时候，问题就出现了。</p>
<p><strong>什么原因？</strong></p>
<p>DOMContentLoaded在外联样式加载前（dom加载完后）就触发了，外联的样式还没来得及渲染dom，这样导致DOMContentLoaded捕获的状态是外联样式渲染前的状态。</p>
<p>改变窗口大小可以重新触发样式的渲染，所以会形成一个假象：</p>
<p>页面进来的时候某个被样式定义过高度的元素的offsetHeight在你改变一下窗口（或者别的可以引起reflow的操作）时，js获取的这个offsetHeight居然不一样的，而在我们看来页面进来时跟窗口改变后，元素本身就没发生高度变化。</p>
<p><strong>总结：</strong></p>
<p>load事件是在页面所有元素都加载完后触发；</p>
<p>DOMContentLoaded，它是指dom tree加载完就触发。这个事件要小心使用，当然它是个强大的事件，起码用上它在某一层面上防止了页面加载被堵塞。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-06-17 -- <a href="http://xiebiji.com/2009/06/mootools-ajax-json/" title="mootools中文实例诠释&#8211;1.2版AJAX,JSON运用">mootools中文实例诠释&#8211;1.2版AJAX,JSON运用</a></li><li>2008-10-12 -- <a href="http://xiebiji.com/2008/10/ge/" title="最近有点忙~连载有点搁置，为某女同学献上一首孙燕姿的歌">最近有点忙~连载有点搁置，为某女同学献上一首孙燕姿的歌</a></li><li>2010-06-07 -- <a href="http://xiebiji.com/2010/06/document-body-scrolltop0/" title="小笔记两个">小笔记两个</a></li><li>2008-08-26 -- <a href="http://xiebiji.com/2008/08/%e6%95%b4%e7%90%86%e7%9a%84%e4%b8%80%e4%b8%aa%e7%9c%9f%e6%ad%a3%e4%b8%ad%e6%96%87mootools%e6%95%99%e7%a8%8b/" title="整理的一个真正中文mootools教程">整理的一个真正中文mootools教程</a></li><li>2008-11-08 -- <a href="http://xiebiji.com/2008/11/wuliao/" title="人无聊的时候什么都会干出来~">人无聊的时候什么都会干出来~</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/03/load/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>2011年第一篇总结[1、2月]</title>
		<link>http://xiebiji.com/2011/02/1_2_summary/</link>
		<comments>http://xiebiji.com/2011/02/1_2_summary/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 03:23:23 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活总结]]></category>
		<category><![CDATA[会议]]></category>
		<category><![CDATA[总结]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2416</guid>
		<description><![CDATA[年末年初事情总是有点繁琐，连写文章的时间都懒得抽出来。
工作方面：
这两个月没发生什么特殊事件，唯一值得记录的是年末那次《速度优化会议》。
这是一次重量级人物的交流会议，我有幸完成了组内的一个优化项目，于是有一次演讲的机会，通过这次会议，我学到了几点东西：

气场很重要。全场演讲者我level最低，要压倒别人得先压到自己，先行者无惧，世界上最无敌的人不是有权有势的人，而是行将就木的人。当然这说法有点夸张，我要表达的只是：每个人都需要把每一天当做生命的最后一天，这样人自然就会有勇气以及规划。
PPT需简洁、话语一步到位、铺垫不可太多。演讲的时候我应该先把主要观点亮出来，恰到好处即可收手。心理学上的“超限效应”值得关注。
要用数据说服别人。其实这个很多人都知道，但是不知道在哪找数据，以及分析数据，这估计也是我要努力的一个方向。
真正牛X的人不在于有多强的技术，只在于能创造多少价值，思路很重要，相关业务扩展度需要增强。
个人影响力需要提高，技术分享需要更多。

生活方面：
抛弃我的人，我不能令其成为最幸福的人，就令其成为带点后悔的人，活好自己，让时间抹掉本不该有的情绪。
更多的文章2011-08-21 -- 最难受的时刻2009-03-31 -- 视觉追踪-F型网页设计2008-09-12 -- 推荐一个可以在BLOG显示自己目前位置的Widget2010-02-18 -- 过年我也会看书的2008-12-18 -- IE ajax 未知运行错误!解决方法！]]></description>
			<content:encoded><![CDATA[<p>年末年初事情总是有点繁琐，连写文章的时间都懒得抽出来。</p>
<p><strong>工作方面：</strong></p>
<p>这两个月没发生什么特殊事件，唯一值得记录的是年末那次《速度优化会议》。</p>
<p>这是一次重量级人物的交流会议，我有幸完成了组内的一个优化项目，于是有一次演讲的机会，通过这次会议，我学到了几点东西：</p>
<ol>
<li>气场很重要。全场演讲者我level最低，要压倒别人得先压到自己，先行者无惧，世界上最无敌的人不是有权有势的人，而是行将就木的人。当然这说法有点夸张，我要表达的只是：每个人都需要把每一天当做生命的最后一天，这样人自然就会有勇气以及规划。</li>
<li>PPT需简洁、话语一步到位、铺垫不可太多。演讲的时候我应该先把主要观点亮出来，恰到好处即可收手。心理学上的“超限效应”值得关注。</li>
<li>要用数据说服别人。其实这个很多人都知道，但是不知道在哪找数据，以及分析数据，这估计也是我要努力的一个方向。</li>
<li>真正牛X的人不在于有多强的技术，只在于能创造多少价值，思路很重要，相关业务扩展度需要增强。</li>
<li>个人影响力需要提高，技术分享需要更多。</li>
</ol>
<p><strong>生活方面：</strong></p>
<p>抛弃我的人，我不能令其成为最幸福的人，就令其成为带点后悔的人，活好自己，让时间抹掉本不该有的情绪。</p>
<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2009-02-10 -- <a href="http://xiebiji.com/2009/02/ai/" title="上当当买了一本书，关于AI的。">上当当买了一本书，关于AI的。</a></li><li>2009-05-03 -- <a href="http://xiebiji.com/2009/05/pager/" title="让flea的FLEA_Helper_Pager类支持数组分页">让flea的FLEA_Helper_Pager类支持数组分页</a></li><li>2008-10-09 -- <a href="http://xiebiji.com/2008/10/hello-sour-sally/" title="Hello Sour Sally!一个好玩的FLASH网站">Hello Sour Sally!一个好玩的FLASH网站</a></li><li>2008-10-06 -- <a href="http://xiebiji.com/2008/10/blogroll/" title="新建了个友情链接展示与交换页面">新建了个友情链接展示与交换页面</a></li><li>2009-12-01 -- <a href="http://xiebiji.com/2009/12/iefirefoxevent/" title="ie和firefox中的事件处理">ie和firefox中的事件处理</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/02/1_2_summary/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>js中html字符串格式化函数</title>
		<link>http://xiebiji.com/2011/02/js%e4%b8%adhtml%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%a0%bc%e5%bc%8f%e5%8c%96%e5%87%bd%e6%95%b0/</link>
		<comments>http://xiebiji.com/2011/02/js%e4%b8%adhtml%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%a0%bc%e5%bc%8f%e5%8c%96%e5%87%bd%e6%95%b0/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 09:02:54 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>
		<category><![CDATA[html格式化]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2414</guid>
		<description><![CDATA[
function style_html&#40;html_source, indent_size, indent_character, max_char&#41; &#123;
//Wrapper function to invoke all the necessary constructors and deal with the output.
&#160;
  var Parser, multi_parser;
&#160;
  function Parser&#40;&#41; &#123;
&#160;
    this.pos = 0; //Parser position
    this.token = '';
    this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT
    [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> style_html<span style="color: #009900;">&#40;</span>html_source<span style="color: #339933;">,</span> indent_size<span style="color: #339933;">,</span> indent_character<span style="color: #339933;">,</span> max_char<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">//Wrapper function to invoke all the necessary constructors and deal with the output.</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">var</span> Parser<span style="color: #339933;">,</span> multi_parser<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #003366; font-weight: bold;">function</span> Parser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//Parser position</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">token</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current_mode</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'CONTENT'</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//reflects the current Parser mode: TAG/CONTENT</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//An object to hold tags, their position, and their parent-tags, initiated with default values</span>
      parent<span style="color: #339933;">:</span> <span style="color: #3366CC;">'parent1'</span><span style="color: #339933;">,</span>
      parentcount<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span>
      parent1<span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">token_text</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">last_token</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">last_text</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">token_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//Uilities made available to the various functions</span>
      whitespace<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\t</span> &quot;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      single_token<span style="color: #339933;">:</span> <span style="color: #3366CC;">'br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed'</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">','</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//all the single tags for HTML</span>
      extra_liners<span style="color: #339933;">:</span> <span style="color: #3366CC;">'head,body,/html'</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">','</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">//for tags that need a line of whitespace before them</span>
      in_array<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>what<span style="color: #339933;">,</span> arr<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>arr.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>what <span style="color: #339933;">===</span> arr<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_content</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//function to capture regular content between tags</span>
&nbsp;
      <span style="color: #003366; font-weight: bold;">var</span> char <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//if a space is needed</span>
      <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'&lt;'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> content.<span style="color: #660066;">length</span><span style="color: #339933;">?</span>content.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'TK_EOF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        char <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #339933;">++;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">++;</span>
&nbsp;
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">in_array</span><span style="color: #009900;">&#40;</span>char<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">whitespace</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>content.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">--;</span>
          <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//don't want to insert unnecessary space</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>space<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">max_char</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//insert a line when the max_char is reached</span>
            content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>this.<span style="color: #660066;">indent_level</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
            content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">++;</span>
          <span style="color: #009900;">&#125;</span>
          space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>char<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//letter at-a-time (or string) inserted to an array</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">return</span> content.<span style="color: #660066;">length</span><span style="color: #339933;">?</span>content.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_script</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//get the full content of a script to pass to js_beautify</span>
&nbsp;
      <span style="color: #003366; font-weight: bold;">var</span> char <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> reg_match <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\&lt;</span><span style="color: #000099; font-weight: bold;">\/</span>script'</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\&gt;</span>'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'igm'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      reg_match.<span style="color: #660066;">lastIndex</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> reg_array <span style="color: #339933;">=</span> reg_match.<span style="color: #660066;">exec</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> end_script <span style="color: #339933;">=</span> reg_array<span style="color: #339933;">?</span>reg_array.<span style="color: #660066;">index</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//absolute end of script</span>
      <span style="color: #000066; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span> <span style="color: #339933;">&lt;</span> end_script<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//get everything in between the script tags</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> content.<span style="color: #660066;">length</span><span style="color: #339933;">?</span>content.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'TK_EOF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        char <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #339933;">++;</span>
&nbsp;
&nbsp;
        content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>char<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">return</span> content.<span style="color: #660066;">length</span><span style="color: #339933;">?</span>content.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">''</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//we might not have any content at all</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">record_tag</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>tag<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//function to record a tag and its parent in this.tags Object</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//check for the existence of this tag type</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//and record the present indent level</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//otherwise initialize this tag type</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//and record the present indent level</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'parent'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span>.<span style="color: #660066;">parent</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//set the parent (i.e. in the case of a div this.tags.div1parent)</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span>.<span style="color: #660066;">parent</span> <span style="color: #339933;">=</span> tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//and make this the current parent (i.e. in the case of a div 'div1')</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">retrieve_tag</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>tag<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//function to retrieve the opening tag to the corresponding closer</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if the openener is not in the Object we ignore it</span>
        <span style="color: #003366; font-weight: bold;">var</span> temp_parent <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span>.<span style="color: #660066;">parent</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//check to see if it's a closable tag.</span>
        <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>temp_parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//till we reach '' (the initial value);</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">===</span> temp_parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if this is it use it</span>
            <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          temp_parent <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>temp_parent <span style="color: #339933;">+</span> <span style="color: #3366CC;">'parent'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//otherwise keep on climbing up the DOM Tree</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>temp_parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if we caught something</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//set the indent_level accordingly</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span>.<span style="color: #660066;">parent</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>temp_parent <span style="color: #339933;">+</span> <span style="color: #3366CC;">'parent'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//and set the current parent</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">delete</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'parent'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//delete the closed tags parent reference...</span>
        <span style="color: #000066; font-weight: bold;">delete</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//...and the tag itself</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">delete</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tags</span><span style="color: #009900;">&#91;</span>tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">'count'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">--;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_tag</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//function to get a full tag and parse its type</span>
      <span style="color: #003366; font-weight: bold;">var</span> char <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">do</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> content.<span style="color: #660066;">length</span><span style="color: #339933;">?</span>content.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">''</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'TK_EOF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        char <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #339933;">++;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">++;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">in_array</span><span style="color: #009900;">&#40;</span>char<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">whitespace</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//don't want to insert unnecessary space</span>
          space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">--;</span>
          <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>char <span style="color: #339933;">===</span> <span style="color: #3366CC;">&quot;'&quot;</span> <span style="color: #339933;">||</span> char <span style="color: #339933;">===</span> <span style="color: #3366CC;">'&quot;'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>content<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> content<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'!'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if we're in a comment strings don't get treated specially</span>
            char <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_unformatted</span><span style="color: #009900;">&#40;</span>char<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>char <span style="color: #339933;">===</span> <span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//no space before =</span>
          space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>content.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;&amp;</span> content<span style="color: #009900;">&#91;</span>content.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'='</span> <span style="color: #339933;">&amp;&amp;</span> char <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'&gt;'</span>
            <span style="color: #339933;">&amp;&amp;</span> space<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//no space after = or before &gt;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span> <span style="color: #339933;">&gt;=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">max_char</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">print_newline</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> content<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">++;</span>
          <span style="color: #009900;">&#125;</span>
          space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>char<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//inserts character at-a-time (or string)</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>char <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #003366; font-weight: bold;">var</span> tag_complete <span style="color: #339933;">=</span> content.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> tag_index<span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_complete.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if there's whitespace, thats where the tag name ends</span>
        tag_index <span style="color: #339933;">=</span> tag_complete.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">' '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//otherwise go with the tag ending</span>
        tag_index <span style="color: #339933;">=</span> tag_complete.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #003366; font-weight: bold;">var</span> tag_check <span style="color: #339933;">=</span> tag_complete.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> tag_index<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toLowerCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_complete.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>tag_complete.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'/'</span> <span style="color: #339933;">||</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">in_array</span><span style="color: #009900;">&#40;</span>tag_check<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">single_token</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if this tag name is a single tag type (either in the list or has a closing /)</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'SINGLE'</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_check <span style="color: #339933;">===</span> <span style="color: #3366CC;">'script'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//for later script handling</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">record_tag</span><span style="color: #009900;">&#40;</span>tag_check<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'SCRIPT'</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_check <span style="color: #339933;">===</span> <span style="color: #3366CC;">'style'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//for future style handling (for now it justs uses get_content)</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">record_tag</span><span style="color: #009900;">&#40;</span>tag_check<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'STYLE'</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_check.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'!'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//peek for &lt;!-- comment</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_check.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[if'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//peek for &lt;!--[if conditional comment</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_complete.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'!IE'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//this type needs a closing --&gt; so...</span>
            <span style="color: #003366; font-weight: bold;">var</span> comment <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_unformatted</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'--&gt;'</span><span style="color: #339933;">,</span> tag_complete<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//...delegate to get_unformatted</span>
            content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>comment<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'START'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_check.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[endif'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">//peek for &lt;!--[endif end conditional comment</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'END'</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">unindent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_check.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'[cdata['</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//if it's a &lt;[cdata[ comment...</span>
          <span style="color: #003366; font-weight: bold;">var</span> comment <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_unformatted</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">']]&gt;'</span><span style="color: #339933;">,</span> tag_complete<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//...delegate to get_unformatted function</span>
          content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>comment<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'SINGLE'</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//&lt;![CDATA[ comments are treated like single tags</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #003366; font-weight: bold;">var</span> comment <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_unformatted</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'--&gt;'</span><span style="color: #339933;">,</span> tag_complete<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          content.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>comment<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'SINGLE'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>tag_check.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'/'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//this tag is a double tag so check for tag-ending</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">retrieve_tag</span><span style="color: #009900;">&#40;</span>tag_check.<span style="color: #660066;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//remove it and all ancestors</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'END'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//otherwise it's a start-tag</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">record_tag</span><span style="color: #009900;">&#40;</span>tag_check<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//push it on the tag stack</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'START'</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">in_array</span><span style="color: #009900;">&#40;</span>tag_check<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">extra_liners</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//check if this double needs an extra line</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">print_newline</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">return</span> content.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//returns fully formatted tag</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_unformatted</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>delimiter<span style="color: #339933;">,</span> orig_tag<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//function to return unformatted content in its entirety</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>orig_tag <span style="color: #339933;">&amp;&amp;</span> orig_tag.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>delimiter<span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #003366; font-weight: bold;">var</span> char <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
      <span style="color: #003366; font-weight: bold;">var</span> space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">do</span> <span style="color: #009900;">&#123;</span>
&nbsp;
&nbsp;
        char <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">pos</span><span style="color: #339933;">++</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">in_array</span><span style="color: #009900;">&#40;</span>char<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">whitespace</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>space<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">--;</span>
            <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>char <span style="color: #339933;">===</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #339933;">||</span> char <span style="color: #339933;">===</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\r</span>'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            content <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>this.<span style="color: #660066;">indent_level</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
              content <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_string</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//...and make sure other indentation is erased</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        content <span style="color: #339933;">+=</span> char<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span><span style="color: #339933;">++;</span>
        space <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
      <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>content.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>delimiter<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">return</span> content<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_token</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//initial handler for token-retrieval</span>
      <span style="color: #003366; font-weight: bold;">var</span> token<span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">last_token</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'TK_TAG_SCRIPT'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//check if we need to format javascript</span>
        <span style="color: #003366; font-weight: bold;">var</span> temp_token <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_script</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> temp_token <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'string'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> temp_token<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        token <span style="color: #339933;">=</span> js_beautify<span style="color: #009900;">&#40;</span>temp_token<span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_size</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_character</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//call the JS Beautifier</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#91;</span>token<span style="color: #339933;">,</span> <span style="color: #3366CC;">'TK_CONTENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current_mode</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'CONTENT'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        token <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_content</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> token <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'string'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> token<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#91;</span>token<span style="color: #339933;">,</span> <span style="color: #3366CC;">'TK_CONTENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">current_mode</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'TAG'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        token <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get_tag</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> token <span style="color: #339933;">!==</span> <span style="color: #3366CC;">'string'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span> token<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #003366; font-weight: bold;">var</span> tag_name_type <span style="color: #339933;">=</span> <span style="color: #3366CC;">'TK_TAG_'</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">tag_type</span><span style="color: #339933;">;</span>
          <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#91;</span>token<span style="color: #339933;">,</span> tag_name_type<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">printer</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>js_source<span style="color: #339933;">,</span> indent_character<span style="color: #339933;">,</span> indent_size<span style="color: #339933;">,</span> max_char<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//handles input/output and some other printing functions</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span> <span style="color: #339933;">=</span> js_source <span style="color: #339933;">||</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//gets the input for the Parser</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">output</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_character</span> <span style="color: #339933;">=</span> indent_character <span style="color: #339933;">||</span> <span style="color: #3366CC;">' '</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_string</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_size</span> <span style="color: #339933;">=</span> indent_size <span style="color: #339933;">||</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">max_char</span> <span style="color: #339933;">=</span> max_char <span style="color: #339933;">||</span> <span style="color: #CC0000;">70</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//maximum amount of characters per line</span>
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//count to see if max_char was exceeded</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>this.<span style="color: #660066;">indent_size</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_string</span> <span style="color: #339933;">+=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_character</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">print_newline</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>ignore<span style="color: #339933;">,</span> arr<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">line_char_count</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>arr <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>arr.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>ignore<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//we might want the extra line</span>
          <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">in_array</span><span style="color: #009900;">&#40;</span>arr<span style="color: #009900;">&#91;</span>arr.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">Utils</span>.<span style="color: #660066;">whitespace</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            arr.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        arr.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>this.<span style="color: #660066;">indent_level</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          arr.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">print_token</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">output</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span><span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">unindent</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">indent_level</span><span style="color: #339933;">--;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #009966; font-style: italic;">/*_____________________--------------------_____________________*/</span>
&nbsp;
&nbsp;
&nbsp;
  multi_parser <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Parser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//wrapping functions Parser</span>
  multi_parser.<span style="color: #660066;">printer</span><span style="color: #009900;">&#40;</span>html_source<span style="color: #339933;">,</span> indent_character<span style="color: #339933;">,</span> indent_size<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//initialize starting values</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">var</span> t <span style="color: #339933;">=</span> multi_parser.<span style="color: #660066;">get_token</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      multi_parser.<span style="color: #660066;">token_text</span> <span style="color: #339933;">=</span> t<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      multi_parser.<span style="color: #660066;">token_type</span> <span style="color: #339933;">=</span> t<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>multi_parser.<span style="color: #660066;">token_type</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">'TK_EOF'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #000066; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>multi_parser.<span style="color: #660066;">token_type</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TK_TAG_START'</span><span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TK_TAG_SCRIPT'</span><span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TK_TAG_STYLE'</span><span style="color: #339933;">:</span>
        multi_parser.<span style="color: #660066;">print_newline</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> multi_parser.<span style="color: #660066;">output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        multi_parser.<span style="color: #660066;">print_token</span><span style="color: #009900;">&#40;</span>multi_parser.<span style="color: #660066;">token_text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        multi_parser.<span style="color: #660066;">indent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        multi_parser.<span style="color: #660066;">current_mode</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'CONTENT'</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TK_TAG_END'</span><span style="color: #339933;">:</span>
        multi_parser.<span style="color: #660066;">print_newline</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> multi_parser.<span style="color: #660066;">output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        multi_parser.<span style="color: #660066;">print_token</span><span style="color: #009900;">&#40;</span>multi_parser.<span style="color: #660066;">token_text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        multi_parser.<span style="color: #660066;">current_mode</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'CONTENT'</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TK_TAG_SINGLE'</span><span style="color: #339933;">:</span>
        multi_parser.<span style="color: #660066;">print_newline</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> multi_parser.<span style="color: #660066;">output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        multi_parser.<span style="color: #660066;">print_token</span><span style="color: #009900;">&#40;</span>multi_parser.<span style="color: #660066;">token_text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        multi_parser.<span style="color: #660066;">current_mode</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'CONTENT'</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
      <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #3366CC;">'TK_CONTENT'</span><span style="color: #339933;">:</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>multi_parser.<span style="color: #660066;">token_text</span> <span style="color: #339933;">!==</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          multi_parser.<span style="color: #660066;">print_newline</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span> multi_parser.<span style="color: #660066;">output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          multi_parser.<span style="color: #660066;">print_token</span><span style="color: #009900;">&#40;</span>multi_parser.<span style="color: #660066;">token_text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        multi_parser.<span style="color: #660066;">current_mode</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'TAG'</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    multi_parser.<span style="color: #660066;">last_token</span> <span style="color: #339933;">=</span> multi_parser.<span style="color: #660066;">token_type</span><span style="color: #339933;">;</span>
    multi_parser.<span style="color: #660066;">last_text</span> <span style="color: #339933;">=</span> multi_parser.<span style="color: #660066;">token_text</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> multi_parser.<span style="color: #660066;">output</span>.<span style="color: #660066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<div  class="related_post_title">与本文相关的日志</div><ul class="related_post"><li>2010-10-20 -- <a href="http://xiebiji.com/2010/10/%e8%87%aa%e5%88%9bjs%e7%b1%bb%e4%b8%8e%e7%bb%a7%e6%89%bf%e7%9a%84%e5%ae%9e%e7%8e%b0/" title="自创js类与继承的实现">自创js类与继承的实现</a></li><li>2010-05-27 -- <a href="http://xiebiji.com/2010/05/active_div/" title="多层div相互层叠激活方法（提升z-index）">多层div相互层叠激活方法（提升z-index）</a></li><li>2010-02-18 -- <a href="http://xiebiji.com/2010/02/ppk/" title="过年我也会看书的">过年我也会看书的</a></li><li>2010-01-31 -- <a href="http://xiebiji.com/2010/01/js_load/" title="实际上js文件放最后是个好方案，但有更好的方案">实际上js文件放最后是个好方案，但有更好的方案</a></li><li>2010-01-30 -- <a href="http://xiebiji.com/2010/01/static_js/" title="js中方法类的拟静态属性、公有属性、私有属性">js中方法类的拟静态属性、公有属性、私有属性</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/02/js%e4%b8%adhtml%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%a0%bc%e5%bc%8f%e5%8c%96%e5%87%bd%e6%95%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>css3可定义大小的矩形遮罩</title>
		<link>http://xiebiji.com/2011/02/css3%e5%8f%af%e5%ae%9a%e4%b9%89%e5%a4%a7%e5%b0%8f%e7%9a%84%e7%9f%a9%e5%bd%a2%e9%81%ae%e7%bd%a9/</link>
		<comments>http://xiebiji.com/2011/02/css3%e5%8f%af%e5%ae%9a%e4%b9%89%e5%a4%a7%e5%b0%8f%e7%9a%84%e7%9f%a9%e5%bd%a2%e9%81%ae%e7%bd%a9/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 05:07:52 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[生活分享]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[mask]]></category>
		<category><![CDATA[自定义大小]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2412</guid>
		<description><![CDATA[css3的mask属性很有趣，以下可自定义一个特定大小的矩形遮罩。

div&#123;
    -webkit-mask-position: 181px 265px;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 96px 101px;
    -webkit-mask-image: url&#40;about:blank&#41;;
&#125;

与本文相关的日志2010-06-21 -- 另类运用,css3临摹苹果mac系统界面2010-01-10 -- [自制]Wordpress 2.9 White-Html5 Theme 1.0主题（双）上线]]></description>
			<content:encoded><![CDATA[<p>css3的mask属性很有趣，以下可自定义一个特定大小的矩形遮罩。</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #00AA00;">&#123;</span>
    -webkit-mask-<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">181px</span> <span style="color: #933;">265px</span><span style="color: #00AA00;">;</span>
    -webkit-mask-<span style="color: #993333;">repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
    -webkit-mask-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">96px</span> <span style="color: #933;">101px</span><span style="color: #00AA00;">;</span>
    -webkit-mask-image<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span>about<span style="color: #00AA00;">:</span>blank<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<div  class="related_post_title">与本文相关的日志</div><ul class="related_post"><li>2010-06-21 -- <a href="http://xiebiji.com/2010/06/css3_mac/" title="另类运用,css3临摹苹果mac系统界面">另类运用,css3临摹苹果mac系统界面</a></li><li>2010-01-10 -- <a href="http://xiebiji.com/2010/01/newtheme/" title="[自制]Wordpress 2.9 White-Html5 Theme 1.0主题（双）上线">[自制]Wordpress 2.9 White-Html5 Theme 1.0主题（双）上线</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/02/css3%e5%8f%af%e5%ae%9a%e4%b9%89%e5%a4%a7%e5%b0%8f%e7%9a%84%e7%9f%a9%e5%bd%a2%e9%81%ae%e7%bd%a9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>textarea获取选中字符位置</title>
		<link>http://xiebiji.com/2011/01/textarea_se/</link>
		<comments>http://xiebiji.com/2011/01/textarea_se/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 11:19:55 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[光标]]></category>
		<category><![CDATA[定位]]></category>
		<category><![CDATA[文本输入框]]></category>
		<category><![CDATA[部分选择]]></category>

		<guid isPermaLink="false">http://xiebiji.com/?p=2410</guid>
		<description><![CDATA[这东西一定要记下来：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//取得选中文本的开始和结束位置，el为textarea dom元素
function posCursor&#40;el&#41;&#123;
	var isIE = !&#40;!document.all&#41;; 
	var start=0,end=0;    
	var oTextarea = el   
	if&#40;isIE&#41;&#123;   
		//selection 当前激活选中区，即高亮文本块，和/或文当中用户可执行某些操作的其它元素。   
		//createRange 从当前文本选中区中创建 TextRange 对象，   
		//或从控件选中区中创建 controlRange 集合。   
		var sTextRange= document.selection.createRange&#40;&#41;;   
&#160;
		//判断选中的是不是textarea对象   
		if&#40;sTextRange.parentElement&#40;&#41;== oTextarea&#41;&#123;   
			//创建一个TextRange对象   
			var oTextRange = document.body.createTextRange&#40;&#41;;  [...]]]></description>
			<content:encoded><![CDATA[<p>这东西一定要记下来：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//取得选中文本的开始和结束位置，el为textarea dom元素</span>
<span style="color: #003366; font-weight: bold;">function</span> posCursor<span style="color: #009900;">&#40;</span>el<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> isIE <span style="color: #339933;">=</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>document.<span style="color: #660066;">all</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #003366; font-weight: bold;">var</span> start<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>end<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>    
	<span style="color: #003366; font-weight: bold;">var</span> oTextarea <span style="color: #339933;">=</span> el   
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>isIE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
		<span style="color: #006600; font-style: italic;">//selection 当前激活选中区，即高亮文本块，和/或文当中用户可执行某些操作的其它元素。   </span>
		<span style="color: #006600; font-style: italic;">//createRange 从当前文本选中区中创建 TextRange 对象，   </span>
		<span style="color: #006600; font-style: italic;">//或从控件选中区中创建 controlRange 集合。   </span>
		<span style="color: #003366; font-weight: bold;">var</span> sTextRange<span style="color: #339933;">=</span> document.<span style="color: #660066;">selection</span>.<span style="color: #660066;">createRange</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
&nbsp;
		<span style="color: #006600; font-style: italic;">//判断选中的是不是textarea对象   </span>
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>sTextRange.<span style="color: #660066;">parentElement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span> oTextarea<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
			<span style="color: #006600; font-style: italic;">//创建一个TextRange对象   </span>
			<span style="color: #003366; font-weight: bold;">var</span> oTextRange <span style="color: #339933;">=</span> document.<span style="color: #660066;">body</span>.<span style="color: #660066;">createTextRange</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
			<span style="color: #006600; font-style: italic;">//移动文本范围以便范围的开始和结束位置能够完全包含给定元素的文本。   </span>
			oTextRange.<span style="color: #660066;">moveToElementText</span><span style="color: #009900;">&#40;</span>oTextarea<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
&nbsp;
			<span style="color: #006600; font-style: italic;">//此时得到两个 TextRange   </span>
			<span style="color: #006600; font-style: italic;">//oTextRange文本域(textarea)中文本的TextRange对象   </span>
			<span style="color: #006600; font-style: italic;">//sTextRange是选中区域文本的TextRange对象   </span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//compareEndPoints方法介绍，compareEndPoints方法用于比较两个TextRange对象的位置   </span>
			<span style="color: #006600; font-style: italic;">//StartToEnd  比较TextRange开头与参数TextRange的末尾。   </span>
			<span style="color: #006600; font-style: italic;">//StartToStart比较TextRange开头与参数TextRange的开头。   </span>
			<span style="color: #006600; font-style: italic;">//EndToStart  比较TextRange末尾与参数TextRange的开头。   </span>
			<span style="color: #006600; font-style: italic;">//EndToEnd    比较TextRange末尾与参数TextRange的末尾。   </span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//moveStart方法介绍，更改范围的开始位置   </span>
			<span style="color: #006600; font-style: italic;">//character 按字符移动   </span>
			<span style="color: #006600; font-style: italic;">//word       按单词移动   </span>
			<span style="color: #006600; font-style: italic;">//sentence  按句子移动   </span>
			<span style="color: #006600; font-style: italic;">//textedit  启动编辑动作   </span>
&nbsp;
			<span style="color: #006600; font-style: italic;">//这里我们比较oTextRange和sTextRange的开头，的到选中区域的开头位置   </span>
			<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>start<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> oTextRange.<span style="color: #660066;">compareEndPoints</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;StartToStart&quot;</span><span style="color: #339933;">,</span> sTextRange<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> start<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>    
				oTextRange.<span style="color: #660066;">moveStart</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'character'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
			<span style="color: #009900;">&#125;</span>   
			<span style="color: #006600; font-style: italic;">//需要计算一下\n的数目(按字符移动的方式不计\n,所以这里加上)    </span>
			<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;=</span> start<span style="color: #339933;">;</span> i <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>oTextarea.<span style="color: #660066;">value</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>    
					start<span style="color: #339933;">++;</span>    
				<span style="color: #009900;">&#125;</span>   
			<span style="color: #009900;">&#125;</span>    
&nbsp;
			<span style="color: #006600; font-style: italic;">//再计算一次结束的位置   </span>
			oTextRange.<span style="color: #660066;">moveToElementText</span><span style="color: #009900;">&#40;</span>oTextarea<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
			<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>end <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> oTextRange.<span style="color: #660066;">compareEndPoints</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'StartToEnd'</span><span style="color: #339933;">,</span> sTextRange<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> end <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
				oTextRange.<span style="color: #660066;">moveStart</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'character'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
			<span style="color: #009900;">&#125;</span>   
			<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;=</span> end<span style="color: #339933;">;</span> i <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>oTextarea.<span style="color: #660066;">value</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>    
					end<span style="color: #339933;">++;</span>    
				<span style="color: #009900;">&#125;</span>   
			<span style="color: #009900;">&#125;</span>   
		<span style="color: #009900;">&#125;</span>   
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
		start <span style="color: #339933;">=</span> oTextarea.<span style="color: #660066;">selectionStart</span><span style="color: #339933;">;</span>   
		end <span style="color: #339933;">=</span> oTextarea.<span style="color: #660066;">selectionEnd</span><span style="color: #339933;">;</span>   
	<span style="color: #009900;">&#125;</span>   
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>s<span style="color: #339933;">:</span>start<span style="color: #339933;">,</span>e<span style="color: #339933;">:</span>end<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>   
<span style="color: #009900;">&#125;</span>
<span style="color: #006600; font-style: italic;">//指定选中文本位置,el为textarea dom元素，start为开始位置由0开始，end为结束位置，假如start=end则只移动光标</span>
<span style="color: #003366; font-weight: bold;">function</span> moveCursor<span style="color: #009900;">&#40;</span>el<span style="color: #339933;">,</span>start<span style="color: #339933;">,</span>end<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
	<span style="color: #003366; font-weight: bold;">var</span> oTextarea <span style="color: #339933;">=</span> el<span style="color: #339933;">;</span>   
	<span style="color: #003366; font-weight: bold;">var</span> start <span style="color: #339933;">=</span> parseInt<span style="color: #009900;">&#40;</span>start<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
	<span style="color: #003366; font-weight: bold;">var</span> end <span style="color: #339933;">=</span>  parseInt<span style="color: #009900;">&#40;</span>end<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>isNaN<span style="color: #009900;">&#40;</span>start<span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span>isNaN<span style="color: #009900;">&#40;</span>end<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
		<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;位置输入错误&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
	<span style="color: #009900;">&#125;</span>   
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>isIE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
		<span style="color: #003366; font-weight: bold;">var</span> oTextRange <span style="color: #339933;">=</span> oTextarea.<span style="color: #660066;">createTextRange</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
		<span style="color: #003366; font-weight: bold;">var</span> LStart <span style="color: #339933;">=</span> start<span style="color: #339933;">;</span>   
		<span style="color: #003366; font-weight: bold;">var</span> LEnd <span style="color: #339933;">=</span> end<span style="color: #339933;">;</span>   
		<span style="color: #003366; font-weight: bold;">var</span> start <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>   
		<span style="color: #003366; font-weight: bold;">var</span> end <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>   
		<span style="color: #003366; font-weight: bold;">var</span> value <span style="color: #339933;">=</span> oTextarea.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>   
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>value.<span style="color: #660066;">length</span> <span style="color: #339933;">&amp;&amp;</span> i<span style="color: #339933;">&lt;</span>LStart<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
			<span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> value.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>c<span style="color: #339933;">!=</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
			start<span style="color: #339933;">++;</span>   
			<span style="color: #009900;">&#125;</span>   
		<span style="color: #009900;">&#125;</span>   
		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span>value.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&gt;=</span>LEnd <span style="color: #339933;">&amp;&amp;</span> i<span style="color: #339933;">&gt;=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">--</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
			<span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> value.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>c<span style="color: #339933;">!=</span><span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>   
				end<span style="color: #339933;">++;</span>   
			<span style="color: #009900;">&#125;</span>   
		<span style="color: #009900;">&#125;</span>   
		oTextRange.<span style="color: #660066;">moveStart</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'character'</span><span style="color: #339933;">,</span> start<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
		oTextRange.<span style="color: #660066;">moveEnd</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'character'</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span>end<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
		<span style="color: #006600; font-style: italic;">//oTextRange.collapse(true);   </span>
		oTextRange.<span style="color: #660066;">select</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
		oTextarea.<span style="color: #000066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
	<span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>   
		oTextarea.<span style="color: #660066;">select</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
		oTextarea.<span style="color: #660066;">selectionStart</span><span style="color: #339933;">=</span>start<span style="color: #339933;">;</span>   
		oTextarea.<span style="color: #660066;">selectionEnd</span><span style="color: #339933;">=</span>end<span style="color: #339933;">;</span>   
	<span style="color: #009900;">&#125;</span>   
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<div  class="related_post_title">更多的文章</div><ul class="related_post"><li>2008-10-09 -- <a href="http://xiebiji.com/2008/10/hello-sour-sally/" title="Hello Sour Sally!一个好玩的FLASH网站">Hello Sour Sally!一个好玩的FLASH网站</a></li><li>2009-09-23 -- <a href="http://xiebiji.com/2009/09/%e5%85%bc%e5%ae%b9ie6%e7%9a%84%e5%85%83%e7%b4%a0%e4%bd%8d%e7%bd%aefixed%e7%9a%84%e6%96%b9%e6%b3%95/" title="兼容ie6的元素位置fixed的方法">兼容ie6的元素位置fixed的方法</a></li><li>2009-07-19 -- <a href="http://xiebiji.com/2009/07/%e7%ac%ac%e4%b8%80%e5%a4%a9%e4%b8%8a%e7%8f%ad%e6%8a%a5%e5%91%8a/" title="第一天上班报告">第一天上班报告</a></li><li>2011-11-19 -- <a href="http://xiebiji.com/2011/11/october_summary/" title="10月总结 &#8212; 得到越多，就要明白得不到或失去时有多悲痛。">10月总结 &#8212; 得到越多，就要明白得不到或失去时有多悲痛。</a></li><li>2008-08-11 -- <a href="http://xiebiji.com/2008/08/fleaphp-%e4%b8%ad%e7%9a%84-mvc-%e6%a8%a1%e5%bc%8f/" title="FleaPHP 中的 MVC 模式">FleaPHP 中的 MVC 模式</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xiebiji.com/2011/01/textarea_se/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

