<?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>阅微堂 &#187; 速度优化.javascript</title>
	<atom:link href="http://zhiqiang.org/blog/tag/%e9%80%9f%e5%ba%a6%e4%bc%98%e5%8c%96javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://zhiqiang.org/blog</link>
	<description>数学、金融、计算机</description>
	<lastBuildDate>Wed, 23 May 2012 08:37:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>加速blog：关于javascript(css)</title>
		<link>http://zhiqiang.org/blog/it/speedup-blog-about-javascript-css.html</link>
		<comments>http://zhiqiang.org/blog/it/speedup-blog-about-javascript-css.html#comments</comments>
		<pubDate>Tue, 04 Dec 2007 12:07:22 +0000</pubDate>
		<dc:creator>zhiqiang</dc:creator>
				<category><![CDATA[IT技术]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[网页技术]]></category>
		<category><![CDATA[速度优化.javascript]]></category>

		<guid isPermaLink="false">http://zhiqiang.org/blog/?p=712</guid>
		<description><![CDATA[博客 » IT技术 » css，网页技术，速度优化.javascript » 这里先谈一下关于javascript和CSS的问题。 压缩你的javascript和css 这里的压缩和前面的GZIP压缩不同，而是压缩空格，去除注释等，调整顺序等。如果你的服务器不支持GZIP压缩，你就更应该使用下面的压缩工具处理你的css和javascript了。 压缩CSS：压缩比率能达到20%到50%。 压缩javascript：即使是最安全的压缩模式，压缩比率也能达...]]></description>
			<content:encoded><![CDATA[<p id="breadcrumb" class="breadcrumb"><a href="http://zhiqiang.org/blog/">博客</a> » <a href="http://zhiqiang.org/blog/category/it">IT技术</a> » <a href="http://zhiqiang.org/blog/tag/css" rel="tag">css</a>，<a href="http://zhiqiang.org/blog/tag/%e7%bd%91%e9%a1%b5%e6%8a%80%e6%9c%af" rel="tag">网页技术</a>，<a href="http://zhiqiang.org/blog/tag/%e9%80%9f%e5%ba%a6%e4%bc%98%e5%8c%96javascript" rel="tag">速度优化.javascript</a> » </p><p>这里先谈一下关于javascript和CSS的问题。</p>
<h3>压缩你的javascript和css</h3>
<p>这里的压缩和前面的GZIP压缩不同，而是压缩空格，去除注释等，调整顺序等。如果你的服务器不支持GZIP压缩，你就更应该使用下面的压缩工具处理你的css和javascript了。</p>
<p><a href="http://www.cssdrive.com/index.php/main/csscompressoradvanced/">压缩CSS</a>：压缩比率能达到20%到50%。</p>
<p>压缩javascript：即使是最安全的压缩模式，压缩比率也能达到20%到50%。</p>
<p>警告：以上压缩会破坏文档格式，请保留好压缩前文档的备份。</p>
<h3>合并javascript和css文件</h3>
<p>这种方面比较繁琐，完全是体力活。可以手动把文件内容都复制粘贴到一起，也可以新写一个php文件include所有需要的文件。在<a href="http://zhiqiang.org/blog/it/wordpress-accelerate-the-pace-of-pages-printed-in-the-generation-and.html">加快WordPress的页面生成和载入速度</a>有比较详细的操作方法。</p>
<h3>javasctip和css文件位置</h3>
<p>一般来说，CSS最好放在HEAD区域内（即&lt;body&gt;之前），这样可以减少页面重绘。javascipt文件越靠后引用越好，比如Google Analytics的统计代码最好放在&lt;/body&gt;之前。也可以考虑<a href="http://msdn.microsoft.com/en-us/library/ms533719.aspx" target="_blank">script的defer属性</a>。</p>
<div><h4>相关文章</h4><ul><li class='currentpost'><a href="http://zhiqiang.org/blog/it/speedup-blog-about-javascript-css.html">加速blog：关于javascript(css)</a></li><li ><a href="http://zhiqiang.org/blog/it/speedup-website-with-css-sprites.html">用CSS Sprites让网站再加速</a></li><li ><a href="http://zhiqiang.org/blog/it/dreamhost-on-gzip-cache.html">Dreamhost上的GZIP &#038; Cache</a></li><li ><a href="http://zhiqiang.org/blog/it/innerhtml-2-cd-issue-dynamic-modification-table-function-of-js.html">innerHTML只读问题 &amp; 两个动态修改Table的js函数</a></li><li ><a href="http://zhiqiang.org/blog/it/speedup-blog-about-images.html">加速blog：处理页面图片</a></li></ul></div>    <p></p>
    <hr noshade style="margin:0;height:1px" />
    <p>&copy; zhiqiang for <a href="http://zhiqiang.org/blog">阅微堂</a>, 2007. | <a href="http://zhiqiang.org/blog/it/speedup-blog-about-javascript-css.html">&#38142;&#25509;</a> | <a href="http://zhiqiang.org/blog/it/speedup-blog-about-javascript-css.html#comments">0&#26465;&#35780;&#35770;</a></p>]]></content:encoded>
			<wfw:commentRss>http://zhiqiang.org/blog/it/speedup-blog-about-javascript-css.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

