<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title><![CDATA[GreenGnn.ORG - 2009 - 8]]></title>
<link>http://www.greengnn.org/index.php/feed/2009/08/</link>
<language>zh-cn</language>
<description><![CDATA[以HTML为中心的WEB体验]]></description>
<pubDate>Fri, 30 Jul 2010 23:37:36 -0500</pubDate>
<item>
<title><![CDATA[Typecho 修改日志]]></title>
<link>http://www.greengnn.org/index.php/2009/08/20/1.html</link>
<pubDate>Thu, 20 Aug 2009 10:11:09 +0000</pubDate>
<category><![CDATA[Typecho]]></category>
<description><![CDATA[2009-9-9


HTML升级为html5格式
添加主导航
添加Resources页面
添加Labs页面


2009-9-1


添加google朋友群


2009-8-20


背景图片随即...]]></description>
<guid>http://www.greengnn.org/index.php/2009/08/20/1.html</guid>
<slash:comments>2</slash:comments>
<comments>http://www.greengnn.org/index.php/2009/08/20/1.html#comments</comments>
<content:encoded><![CDATA[<p>2009-9-9</p><ul><li>HTML升级为html5格式</li><li>添加主导航</li><li>添加Resources页面</li><li>添加Labs页面</li></ul><p>2009-9-1</p><ul><li>添加google朋友群</li></ul><p>2009-8-20</p><ul><li>背景图片随即切换</li><li>IE6浏览器升级提示</li></ul><p>&nbsp;</p>]]></content:encoded>
<author><![CDATA[greengnn]]></author>
<dc:creator><![CDATA[greengnn]]></dc:creator>
<wfw:commentRss>http://www.greengnn.org/index.php/feed/2009/08/20/1.html</wfw:commentRss>
</item>
<item>
<title><![CDATA[JavaScript 模板]]></title>
<link>http://www.greengnn.org/index.php/2009/08/10/5.html</link>
<pubDate>Sun, 09 Aug 2009 16:01:42 +0000</pubDate>
<category><![CDATA[JavaScript]]></category>
<description><![CDATA[JavaScript模板是什么东东？懂php smarty框架的人应该能够理解模板，作为MVC的view层，为什么对这个东西感兴趣，最近给blog添加google日历，用的是json的方式，用创建do...]]></description>
<guid>http://www.greengnn.org/index.php/2009/08/10/5.html</guid>
<slash:comments>1</slash:comments>
<comments>http://www.greengnn.org/index.php/2009/08/10/5.html#comments</comments>
<content:encoded><![CDATA[<p>JavaScript模板是什么东东？懂php smarty框架的人应该能够理解模板，作为MVC的view层，为什么对这个东西感兴趣，最近给blog添加google日历，用的是json的方式，用创建dom的方式展示数据超级麻烦，而且死google的json嵌套又特别复杂，为了维护方便还是用js模板比较好一些。<br />不过还没应用到blog上，先看我的<a href="http://www.greengnn.org/lab/template/" target="_blank">demo</a></p><p>下面就粘贴几个不错的模板资料，还有<a href="http://www.twinsenliang.net" target="_blank">twinsenliang</a>弄的WTemplet。</p><ul><li>一个简单的JavaScript模板原理教程<a href="http://bbs.blueidea.com/viewthread.php?tid=2735200" target="_blank">客户端模版应用</a></li><li><a href="http://www.webrebuild.org/wtemplet/" target="_blank">WTemplet</a>，请重点看下这个技术所传达的web开发流程优化</li><li>一个完善的牛逼的老外的<a href="http://code.google.com/p/trimpath/wiki/JavaScriptTemplates" target="_blank">JavaScriptTemplates</a>，先一睹他的<a href="http://trimpath.com/demos/test1/trimpath/template_demo.html" target="_blank">demo</a></li></ul><p>JavaScriptTemplates想多说几句，他是TrimPath项目的一个部分，目的是在js基础上实现MVC的模式，应用google gears的离线技术等创建牛逼的客户端应用，JavaScriptTemplates只是TrimPath的view层应用。该项目中还包含了一个<a href="http://code.google.com/p/trimpath/wiki/TrimQuery" target="_blank">TrimQuery</a>，我个人对js知道的甚少，觉得这个玩意也很牛逼，因为他实现客户端使用SQL的方式查询数据，直接看他的<a href="http://trimpath.com/demos/test1/trimpath/query_demo.html" target="_blank">demo</a>一目了然，反正我能看懂的洋码子也不对。这个项目在<a href="http://code.google.com/p/trimpath/" target="_blank">Google code</a>开源了，可以方便拿到代码，自己顺便留个记号，以防以后用得到。</p><p>取他例子的一段代码看看：<br />TrimQuery</p><pre>
SELECT Customer.id, Customer.acctBalance, Invoice.total
FROM Customer, Invoice
WHERE Customer.id = Invoice.custId
ORDER BY Customer.id
</pre><p>JavaScriptTemplates</p><pre>
&lt;table&gt;
&lt;tr&gt;&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;Description&lt;/td&gt;
&lt;td&gt;Price&lt;/td&gt;
&lt;td&gt;Quantity &amp; Alert&lt;/td&gt;
&lt;/tr&gt;
{for p in products}
&lt;tr&gt;&lt;td&gt;${p.name|capitalize}&lt;/td&gt;&lt;td&gt;${p.desc}&lt;/td&gt;
&lt;td&gt;$${p.price}&lt;/td&gt;&lt;td&gt;${p.quantity} :
${p.alert|default:&quot;&quot;|capitalize}&lt;/td&gt;
&lt;/tr&gt;
{forelse}
&lt;tr&gt;&lt;td colspan=&quot;4&quot;&gt;No products in your cart.&lt;/tr&gt;
{/for}
&lt;/table&gt;
</pre>]]></content:encoded>
<author><![CDATA[greengnn]]></author>
<dc:creator><![CDATA[greengnn]]></dc:creator>
<wfw:commentRss>http://www.greengnn.org/index.php/feed/2009/08/10/5.html</wfw:commentRss>
</item>
<item>
<title><![CDATA[应用google gears提高打开速度]]></title>
<link>http://www.greengnn.org/index.php/2009/08/06/4.html</link>
<pubDate>Thu, 06 Aug 2009 15:51:55 +0000</pubDate>
<category><![CDATA[JavaScript]]></category>
<category><![CDATA[Performance]]></category>
<category><![CDATA[google]]></category>
<description><![CDATA[google gears是提供离线存储的一个平台，NB的应用gmail的离线版，google日历的离线版等，他的本地存储对不经常变动的静态文件进行存储，降低请求数挺爽的，qzone已经采用了，不过今天...]]></description>
<guid>http://www.greengnn.org/index.php/2009/08/06/4.html</guid>
<slash:comments0/>
<comments>http://www.greengnn.org/index.php/2009/08/06/4.html#comments</comments>
<content:encoded><![CDATA[<p>google gears是提供离线存储的一个平台，NB的应用gmail的离线版，google日历的离线版等，他的<a href="http://code.google.com/intl/zh-CN/apis/gears/api_localserver.html#overview" target="_blank">本地存储</a>对不经常变动的静态文件进行存储，降低请求数挺爽的，qzone已经采用了，不过今天我测试了下又没了。</p><p>下面简单几句就搞定静态文件的存储，如果安装了gears，就可以体验到我的blog的文件本地存储服务。<br />一个完整的<a href="http://www.greengnn.org/lab/gears/index.html" target="_blank">离线测试demo</a>。</p><p>简单的代码</p><pre>&lt;script&nbsp;type="text/javascript"&nbsp;src="gears_init.js"&gt;&lt;/script&gt;
&lt;script&nbsp;type="text/javascript"&gt;
var&nbsp;localServer&nbsp;=&nbsp;google.gears.factory.create('beta.localserver');
var&nbsp;store&nbsp;=&nbsp;localServer.createManagedStore('test-store');
store.manifestUrl&nbsp;=&nbsp;'site-manifest.txt';
store.checkForUpdate();
&lt;/script&gt;</pre><pre>//&nbsp;site-manifest.txt
{
&nbsp;&nbsp;"betaManifestVersion":&nbsp;1,
&nbsp;&nbsp;"version":&nbsp;"site_version_string",
&nbsp;&nbsp;"entries":&nbsp;[
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"url":&nbsp;"site.html"&nbsp;},
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;"url":&nbsp;"gears_init.js"&nbsp;}
&nbsp;&nbsp;]
}</pre>]]></content:encoded>
<author><![CDATA[greengnn]]></author>
<dc:creator><![CDATA[greengnn]]></dc:creator>
<wfw:commentRss>http://www.greengnn.org/index.php/feed/2009/08/06/4.html</wfw:commentRss>
</item>
<item>
<title><![CDATA[js和css文件的延迟加载]]></title>
<link>http://www.greengnn.org/index.php/2009/08/06/3.html</link>
<pubDate>Thu, 06 Aug 2009 01:44:28 +0000</pubDate>
<category><![CDATA[JavaScript]]></category>
<category><![CDATA[Performance]]></category>
<description><![CDATA[正常情况下，文件会被写到head区域，不管本页面用得到用不到就要加载，这种方式会造成一次性请求数过多加大block的时间，也容易造成文件字节过大。

延迟加载的方案是通过js在dom需要的位置load...]]></description>
<guid>http://www.greengnn.org/index.php/2009/08/06/3.html</guid>
<slash:comments0/>
<comments>http://www.greengnn.org/index.php/2009/08/06/3.html#comments</comments>
<content:encoded><![CDATA[<p>正常情况下，文件会被写到head区域，不管本页面用得到用不到就要加载，这种方式会造成一次性请求数过多加大block的时间，也容易造成文件字节过大。</p><p>延迟加载的方案是通过js在dom需要的位置load文件，比如一些需要用户触发才展示的组件，日历选择，弹出框等。</p><p>一个<a href="http://www.greengnn.org/lab/load/test.html" target="_blank">demo</a></p><pre>function&nbsp;loadScript(url,&nbsp;callback){

&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;script&nbsp;=&nbsp;document.createElement("script")
&nbsp;&nbsp;&nbsp;&nbsp;script.type&nbsp;=&nbsp;"text/javascript";

&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(script.readyState){&nbsp;&nbsp;//IE
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;script.onreadystatechange&nbsp;=&nbsp;function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(script.readyState&nbsp;==&nbsp;"loaded"&nbsp;||
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;script.readyState&nbsp;==&nbsp;"complete"){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;script.onreadystatechange&nbsp;=&nbsp;null;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callback();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{&nbsp;&nbsp;//Others
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;script.onload&nbsp;=&nbsp;function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callback();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;script.src&nbsp;=&nbsp;url;
&nbsp;&nbsp;&nbsp;&nbsp;document.getElementsByTagName("head")[0].appendChild(script);
}
function&nbsp;loadCSS(url){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;cssLink&nbsp;=&nbsp;document.createElement("link");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cssLink.rel&nbsp;=&nbsp;"stylesheet";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cssLink.rev&nbsp;=&nbsp;"stylesheet";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cssLink.type&nbsp;=&nbsp;"text/css";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cssLink.media&nbsp;=&nbsp;"screen";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cssLink.href&nbsp;=&nbsp;url;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementsByTagName("head")[0].appendChild(cssLink);
}</pre>]]></content:encoded>
<author><![CDATA[greengnn]]></author>
<dc:creator><![CDATA[greengnn]]></dc:creator>
<wfw:commentRss>http://www.greengnn.org/index.php/feed/2009/08/06/3.html</wfw:commentRss>
</item>
<item>
<title><![CDATA[使用Typecho]]></title>
<link>http://www.greengnn.org/index.php/2009/08/06/start.html</link>
<pubDate>Thu, 06 Aug 2009 01:09:29 +0000</pubDate>
<category><![CDATA[my]]></category>
<category><![CDATA[Typecho]]></category>
<description><![CDATA[Typecho是一个国内和WP类似的blog系统，对比WP，速度是嗷嗷叫的，所以弃用了WP，而且发现他的模版做起来很容易，不到两个小时，编码和调试，一个新的皮肤就诞生了。

新皮肤对不同浏览器提供差异...]]></description>
<guid>http://www.greengnn.org/index.php/2009/08/06/start.html</guid>
<slash:comments0/>
<comments>http://www.greengnn.org/index.php/2009/08/06/start.html#comments</comments>
<content:encoded><![CDATA[<p>Typecho是一个国内和WP类似的blog系统，对比WP，速度是嗷嗷叫的，所以弃用了WP，而且发现他的模版做起来很容易，不到两个小时，编码和调试，一个新的皮肤就诞生了。</p><p>新皮肤对不同浏览器提供差异化的界面，让支持CSS优秀的浏览器用户享受最佳的用户体验。</p><p>以后写博客也尽量避免冗长的废话，几句话切入重点，写着也轻松，别人看着也不累。</p>]]></content:encoded>
<author><![CDATA[greengnn]]></author>
<dc:creator><![CDATA[greengnn]]></dc:creator>
<wfw:commentRss>http://www.greengnn.org/index.php/feed/2009/08/06/start.html</wfw:commentRss>
</item>
</channel>
</rss>