<?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>Hi, I'm Adam Lu.</title>
	<atom:link href="http://adamlu.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://adamlu.com</link>
	<description>Web Frontend Development, Design, Music, Life------Stay Hungry, Stay Foolish~</description>
	<lastBuildDate>Wed, 16 May 2012 03:05:10 +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>Javascript Sort</title>
		<link>http://adamlu.com/?p=706</link>
		<comments>http://adamlu.com/?p=706#comments</comments>
		<pubDate>Tue, 15 May 2012 10:17:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript/DHTML]]></category>
		<category><![CDATA[排序算法]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=706</guid>
		<description><![CDATA[之前看到有一个例子演示排序的一系列算法，在Javascript中怎么实现呢？ 1.合并排序 算法核心是将一堆数组中前后相邻的两个有序序列合并成一个有序序列，采用递归来实现，先进行划分，再进行合并。 function merge(left, right) { var result = []; while (left.length &#62; 0 &#38;&#38; right.length &#62; 0) { if (left[0] &#60; right[0]) { result.push(left.shift()); } else { result.push(right.shift()); } } return result.concat(left).concat(right); } function mergeSort(arr) { if (arr.length &#60;= 1) { return arr; } var middle = Math.floor(arr.length / 2); var left = [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Mathematic in Javascript(2)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D434&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Mathematic in Javascript(2)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Mathematic in Javascript" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D422&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Mathematic in Javascript</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="YUI3的Widget组件介绍" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D504&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11435829.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">YUI3的Widget组件介绍</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Ajax文本实时编辑" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D6&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11437567.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Ajax文本实时编辑</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>之前看到有一个<a href="http://jsdo.it/norahiko/oxIy/fullscreen" target="_blank">例子演示</a>排序的一系列算法，在Javascript中怎么实现呢？</p>
<p>1.合并排序<br />
算法核心是将一堆数组中前后相邻的两个有序序列合并成一个有序序列，采用递归来实现，先进行划分，再进行合并。</p>
<pre>
function merge(left, right) {
var result = [];
while (left.length &gt; 0 &amp;&amp; right.length &gt; 0) {
if (left[0] &lt; right[0]) {
result.push(left.shift());
} else {
result.push(right.shift());
}
}

return result.concat(left).concat(right);
}
function mergeSort(arr) {
if (arr.length &lt;= 1) {
return arr;
}
var middle = Math.floor(arr.length / 2);
var left = arr.slice(0, middle);
var right = arr.slice(middle);

return merge(mergeSort(left), mergeSort(right));
}
</pre>
<p>2. 快速排序<br />
算法核心是先在数组中选择一个枢纽值，然后将比这个枢纽值小的元素移到左边，大于枢纽值的元素移到后边，对枢纽两边的值递归进行这么操作直至只有一个元素。</p>
<pre>
function quickSort(arr) {
if (arr.length &lt;= 1) {
return arr;
}
var pivot = arr.splice(Math.floor(arr.length / 2), 1)[0];
var left = [];
var right = [];
for (var i = 0; i &lt; arr.length; i++) {
if (arr[i] &lt; pivot) {
left.push(arr[i]);
} else {
right.push(arr[i]);
}
}

return quickSort(left).concat([pivot], quickSort(right));
}
</pre>
<p>3. 冒泡排序<br />
算法核心是从上往下扫描数组，比较相邻两个元素，大的在数组的后面，小的在前面，如果不符合则交换二者位置。</p>
<pre>
function bubbleSort(arr) {
if (arr.length &lt;= 1) {
return arr;
}
for (var i = arr.length - 1; i &gt; 0; i--) {
for (var j = i - 1; j &gt;= 0; j--) {
if (arr[j] &lt; arr[j - 1]) {
var tmp = arr[j];
arr[j] = arr[j - 1];
arr[j - 1] = tmp;
}
}
}

return arr;
}
</pre>
<p>4. 选择排序<br />
算法核心是首先在未排序序列中找到最小元素，放在排序序列的起始位置，再从未排序序列中找到最小元素放到排序序列末尾位置。</p>
<pre>
function selectSort(arr) {
var min, tmp;
for (var i = 0; i &lt; arr.length; i++) {
min = i;
for (var j = i + 1; j &lt; arr.length; j++) {
if (arr[min] &gt; arr[j]) {
min = j;
}
}
if (min != i) {
tmp = arr[i];
arr[i] = arr[min];
arr[min] = tmp;
}
}

return arr;
}
</pre>
<p>5. 插入排序<br />
算法核心是每次从无序列表中取出第一个元素，把它插入到有序表的合适位置，使有序表仍然有序。</p>
<pre>
function insertSort(arr) {
for (var i = 1; i &lt; arr.length; i++) {
var tmp = arr[i],
j = i;
while (arr[j - 1] &gt; tmp) {
arr[j] = arr[j - 1];
--j;
}
arr[j] = tmp;
}

return arr;
}
};
</pre>
<p>6. 数组的原生Sort方法<br />
在sort内传入对比function就可以</p>
<pre>
arr.sort(function(a, b) {
return a - b;
});
</pre>
<p>上面这几种排序方法性能如下（数据量比较小的情况下），测试地址：<a href="http://jsperf.com/javascript-sort" target="_blank">http://jsperf.com/javascript-sort</a></p>
<p><img class="alignnone" src="http://ww3.sinaimg.cn/large/96d52b23gw1dsz5xkto5yj.jpg" alt="" width="529" height="263" /></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Mathematic in Javascript(2)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D434&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Mathematic in Javascript(2)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Mathematic in Javascript" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D422&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Mathematic in Javascript</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="YUI3:更快，更轻量，更容易用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D70&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11438340.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">YUI3:更快，更轻量，更容易用</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="由“支付宝缴费页面问题”探讨所想到的" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D45&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11437284.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">由“支付宝缴费页面问题”探讨所想到的</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=706</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Started with YUI</title>
		<link>http://adamlu.com/?p=697</link>
		<comments>http://adamlu.com/?p=697#comments</comments>
		<pubDate>Fri, 30 Mar 2012 09:24:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript/DHTML]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=697</guid>
		<description><![CDATA[Get started with YUI View more PowerPoint from Adam Lu<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D492&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3.3.0新特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D389&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用YUI3组织网站结构</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D504&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3的Widget组件介绍</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D314&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3中的继承和重用</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div style="width:510px" id="__ss_12219597"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/adamlu/get-started-with-yui" title="Get started with YUI" target="_blank">Get started with YUI</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12219597" width="510" height="426" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/thecroaker/death-by-powerpoint" target="_blank">PowerPoint</a> from <a href="http://www.slideshare.net/adamlu" target="_blank">Adam Lu</a> </div>
</p></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D492&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3.3.0新特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D389&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用YUI3组织网站结构</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D504&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3的Widget组件介绍</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D314&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3中的继承和重用</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=697</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML5 on Mobile</title>
		<link>http://adamlu.com/?p=691</link>
		<comments>http://adamlu.com/?p=691#comments</comments>
		<pubDate>Wed, 21 Mar 2012 09:54:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=691</guid>
		<description><![CDATA[HTML5 on Mobile View more PowerPoint from Adam Lu 在淘宝技术沙龙上的演讲视频：<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="YUI3:更快，更轻量，更容易用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D70&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11438340.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">YUI3:更快，更轻量，更容易用</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Web Storage APIs" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D580&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/07/07/16555761.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Web Storage APIs</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="提高网站可访问性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D542&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11435735.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">提高网站可访问性</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="IOS5的Mobile Safari新特性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/10/03/8479442.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">IOS5的Mobile Safari新特性</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div style="width:510px" id="__ss_12092503"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/adamlu/html5-on-mobile-12092503" title="HTML5 on Mobile" target="_blank">HTML5 on Mobile</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12092503" width="510" height="426" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/thecroaker/death-by-powerpoint" target="_blank">PowerPoint</a> from <a href="http://www.slideshare.net/adamlu" target="_blank">Adam Lu</a> </div>
</div>
<p>在淘宝技术沙龙上的演讲视频：<br />
<embed src="http://player.youku.com/player.php/sid/XMzczNzUyMDU2/v.swf" quality="high" width="510" height="420" align="middle" allowScriptAccess="sameDomain" allowFullscreen="true" type="application/x-shockwave-flash"></embed></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Adobe Flash平台技术峰会感受" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D372&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11436409.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Adobe Flash平台技术峰会感受</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="使用ARIA，增强网站可访问性" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D332&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11437163.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用ARIA，增强网站可访问性</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="YUICONF 2009 PPT笔记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D184&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11438185.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">YUICONF 2009 PPT笔记</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="YUI3:更快，更轻量，更容易用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D70&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D691">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11438340.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">YUI3:更快，更轻量，更容易用</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=691</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 on Mobile(For Developer)</title>
		<link>http://adamlu.com/?p=686</link>
		<comments>http://adamlu.com/?p=686#comments</comments>
		<pubDate>Fri, 02 Mar 2012 09:35:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=686</guid>
		<description><![CDATA[Html5 on Mobile(For Developer) View more PowerPoint from Adam Lu<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile (For Designer)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debugging Mobile Web Page</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D450&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">重新认识HTML5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D396&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5相关资源</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<div style="width:510px" id="__ss_11829313"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/adamlu/html5-on-mobilefor-developer" title="Html5 on Mobile(For Developer)" target="_blank">Html5 on Mobile(For Developer)</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/11829313" width="510" height="426" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/thecroaker/death-by-powerpoint" target="_blank">PowerPoint</a> from <a href="http://www.slideshare.net/adamlu" target="_blank">Adam Lu</a> </div>
</p></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile (For Designer)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debugging Mobile Web Page</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D450&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">重新认识HTML5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D396&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5相关资源</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=686</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HTML5 on Mobile (For Designer)</title>
		<link>http://adamlu.com/?p=671</link>
		<comments>http://adamlu.com/?p=671#comments</comments>
		<pubDate>Tue, 07 Feb 2012 10:09:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=671</guid>
		<description><![CDATA[I Introduced some HTML5 features on mobile and how to build and design the mobile web page from the perspective of designer in today&#8217;s share meeting. Here is the slide in slideshare.net, I&#8217;m going to have a topic about &#8220;HTML5 on mobile&#8221; for developer in future. HTML5 on Mobile(For Designer)<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="HTML5 on Mobile(For Developer)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Debugging Mobile Web Page" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2012/01/13/13904774.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Debugging Mobile Web Page</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WebRebuild大会演讲《揭秘HTML5和CSS3》分享" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D223&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11436352.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WebRebuild大会演讲《揭秘HTML5和CSS3》分享</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="HTML5相关资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D396&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5相关资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>I Introduced some HTML5 features on mobile and how to build and design the mobile web page from the perspective of designer in today&#8217;s share meeting.</p>
<p>Here is the slide in slideshare.net, I&#8217;m going to have a topic about &#8220;HTML5 on mobile&#8221; for developer in future.</p>
<div style="width:510px" id="__ss_11459299"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/adamlu/html5-on-mobilefor-designer" title="HTML5 on Mobile(For Designer)" target="_blank">HTML5 on Mobile(For Designer)</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/11459299" width="510" height="426" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="HTML5 on Mobile(For Developer)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Debugging Mobile Web Page" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2012/01/13/13904774.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Debugging Mobile Web Page</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WebRebuild大会演讲《揭秘HTML5和CSS3》分享" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D223&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11436352.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WebRebuild大会演讲《揭秘HTML5和CSS3》分享</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="HTML5相关资源" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D396&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5相关资源</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=671</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Mobile Web Page</title>
		<link>http://adamlu.com/?p=642</link>
		<comments>http://adamlu.com/?p=642#comments</comments>
		<pubDate>Fri, 13 Jan 2012 06:23:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[调试]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=642</guid>
		<description><![CDATA[在PC端的开发中我们拥有很多前端开发调试工具, 但是Mobile端的调试相对比较麻烦一些, 不光要在浏览器上调试, 而且很多都需要在真实的设备上来调试, 设备的类型/制造商/操作系统, 网络环境都会影响Web的调试. PC上开发 从我的经验来看我一般先是使用Safari的模拟User Agent来开发Mobile Page, 开启Safari, 选择设置, 高级, 显示&#8221;开发&#8221;工具菜单, 这样你就能在Safari的菜单中看到&#8221;开发&#8221;了, 然后就可以选择一些User Agent: 但是有时可能还需要模拟Android Safari上的User Agent, 如 Google Nexus One: Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17 –Nexus Android Tablet: Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1 [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D527&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用HTML5和CSS3构建基于webkit的Web Page/App</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile (For Designer)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">IOS5的Mobile Safari新特性</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在PC端的开发中我们拥有很多<a href="http://adamlu.com/?p=268" target="_blank">前端开发调试工具</a>, 但是Mobile端的调试相对比较麻烦一些, 不光要在浏览器上调试, 而且很多都需要在真实的设备上来调试, 设备的类型/制造商/操作系统, 网络环境都会影响Web的调试.</p>
<h2>PC上开发</h2>
<p>从我的经验来看我一般先是使用Safari的模拟User Agent来开发Mobile Page, 开启Safari, 选择设置, 高级, 显示&#8221;开发&#8221;工具菜单, 这样你就能在Safari的菜单中看到&#8221;开发&#8221;了, 然后就可以选择一些User Agent:</p>
<p><img class="alignnone" src="http://developer.apple.com/library/safari/documentation/appleapplications/Conceptual/Safari_Developer_Guide/Art/useragents.jpg" alt="" width="164" height="232" /></p>
<p>但是有时可能还需要模拟Android Safari上的User Agent, 如</p>
<p><strong>Google Nexus One</strong>: Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17 –Nexus</p>
<p><strong>Android Tablet</strong>: Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1</p>
<p>只需要选择&#8221;Other&#8221;把自定义的User Agent输入进去即可.</p>
<h2>模拟器上调试</h2>
<p>当然Safari的<a href="http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/Safari_Developer_Guide/2SafariDeveloperTools/SafariDeveloperTools.html" target="_blank">开发者工具</a>也不比<a href="http://getfirebug.com/" target="_blank">Firebug</a>差, 在桌面的Safari开发完成后, 还需要在模拟器上进行调试, iOS的Simulator需要安装<a href="http://developer.apple.com/xcode/" target="_blank">XCode</a>, <a href="http://developer.apple.com/xcode/" target="_blank">XCode</a>是用于开发Apple系列产品如Mac, iPhone, iPad上的集成开发环境, 包括IDE, Instruments,<a href="http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/25-Using_iOS_Simulator/ios_simulator_application.html" target="_blank"> </a><a href="http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/25-Using_iOS_Simulator/ios_simulator_application.html" target="_blank">iOS Simulator</a>以及最新的Mac OS X和iOS SDK.安装完<a href="http://developer.apple.com/xcode/" target="_blank">XCode</a>后, 在/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications这个目录下, 打开<a href="http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/25-Using_iOS_Simulator/ios_simulator_application.html" target="_blank">iOS Simulator</a>就可以运行了, 界面如下:</p>
<p><img class="alignnone" src="http://rendernaut.com/wp-content/uploads/2011/01/iPhone-Simulator.png" alt="" width="203" height="405" /></p>
<p>这样你就可以看到底部有Safari的浏览器, 通过打开设置-&gt;Safari-&gt;开发者-&gt;高级-&gt;调试控制台, 设置为开就可以打开Safari的控制台了, console.log/console.error的输出都会出现在控制台里面.</p>
<p>Android的Emulator安装请参考<a href="http://developer.android.com/guide/developing/devices/emulator.html" target="_blank">http://developer.android.com/guide/developing/devices/emulator.html</a></p>
<h3>在模拟器上使用HOST文件</h3>
<p>使用模拟器通常需要绑定开发环境的host, iPhone的模拟器会使用你Mac电脑的host文件, 这个比较方便, 而Android的Emulator修改host会比较麻烦, 因为它不会使用你本机的host文件, 下面来说一下怎么修改:</p>
<p>1.在<span>android-sdk/tools/目录下</span>启动Android Virtual Device(AVD): <span>emulator -avd myAvdNameHere -partition-size 128</span></p>
<p><span>2. </span><span>adb remount</span></p>
<p><span>3. </span><span>adb push /etc/hosts /system/etc</span></p>
<h2><span>设备上调试</span></h2>
<p>最后就是设备调试阶段, 同样iPhone越狱的手机可以在Cydia安装<a href="http://www.ijailbreak.com/cydia/mobile-terminal-ios5/" target="_blank">mobile terminal</a>这款软件来修改host文件, Android手机同样也有<a href="http://boffee.com/android-host/" target="_blank">修改host</a>的方法.</p>
<p>对于Mobile上的调试还有一个很有用的bookmark工具<a href="http://stevesouders.com/mobileperf/mobileperfbkm.php" target="_blank">Mobile Perf bookmarklet</a>, 它是由Google的Steve Souders创建的一个针对Mobile的调试工具列表, 如 <a href="http://getfirebug.com/firebuglite#Stable" target="_blank">Firebug Lite</a>, <a href="http://stevesouders.com/mobileperf/pageresources.php" target="_blank">Page Resources</a>, <a href="http://mir.aculo.us/dom-monster/" target="_blank">DOM Monster</a>, <a href="http://spriteme.org/" target="_blank">SpriteMe</a>, <a href="http://razorfast.com/2010/11/21/announcing-cssess-the-bookmarklet-that-finds-unused-css-selectors/" target="_blank">CSSess</a>, <a href="http://zoompf.com/zoompf-bookmark" target="_blank">Zoompf</a>等, 其中有些已经集成了<a href="http://jdrop.org/" target="_blank">Jdrop</a>(云端Json数据存储平台), 这样就可以很方便地在PC上分析Mobile的数据了, iPhone上的安装请看<a href="http://stevesouders.com/mobileperf/iphonesteps.php" target="_blank">这里</a>.</p>
<h2>远程调试</h2>
<p>刚才说了Mobile上的数据不太好分析, 如果能在PC上调试Mobile上的页面就好了, 所以也出现了很多远程调试工具, 下面介绍几个:</p>
<p>1. <a href="http://phonegap.github.com/weinre/" target="_blank">Weinre</a>, 这是一个很强大的远程调试工具, <a href="http://phonegap.github.com/weinre/" target="_blank">Weinre</a>是&#8221;<strong>WE</strong><span>b </span><strong>IN</strong><span>spector </span><strong>RE</strong><span>mote&#8221;的缩写, 通过它你可以在PC上使用Safari的开发者工具来调试Mobile上的页面, 你也可以在线使用</span><a href="http://debug.phonegap.com/" target="_blank">http://debug.phonegap.com/</a>或是下载<a href="http://phonegap.github.com/weinre/" target="_blank">Weinre</a>的客户端软件.</p>
<p>2. <a href="http://jsconsole.com/remote-debugging.html" target="_blank">Jsconsole</a>, 这是一个Javascript命令行工具, 它也提供了远程调试的功能.</p>
<p>3. <a href="http://www.opera.com/dragonfly/documentation/remote/" target="_blank">Opera Dragonfly</a>, Opera浏览器提供的开发者工具, 也很方便, 如果你的网站是需要兼容Opera的话可以试一下.</p>
<p>4. <a href="http://socketbug.com/" target="_blank">Socketbug</a>, 建立在<a href="http://nodejs.org/" target="_blank">Node.js</a>和<a href="http://socket.io/" target="_blank">Socket.IO</a>上的Mobile Web调试工具.</p>
<p>5. <a href="http://wesbos.com/remote-debugging-mobile-chrome-android/" target="_blank">Remote Debugging with Chrome for Android</a>, 通过USB调试模式和android sdk自带的工具同时使用chrome的开发工具远程调试android上的页面.</p>
<p>6. <a href="http://labs.adobe.com/technologies/shadow/" target="_blank">Adobe Shadow</a>, 安装了<a href="http://labs.adobe.com/technologies/shadow/" target="_blank">Adobe Shadow</a>后就可以同步手机设备和PC，然后就可以在PC上远端调试Mobile上的页面。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D527&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用HTML5和CSS3构建基于webkit的Web Page/App</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile (For Designer)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">IOS5的Mobile Safari新特性</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=642</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>针对webkit的HTML, CSS和Javascript</title>
		<link>http://adamlu.com/?p=633</link>
		<comments>http://adamlu.com/?p=633#comments</comments>
		<pubDate>Tue, 06 Dec 2011 09:44:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=633</guid>
		<description><![CDATA[前面有一篇文章介绍了HTML5的一些新特性以及技巧, 现再来总结一些更多的针对webkit的HTML, CSS和Javascript方面的特性. HTML, 从HTML文档的开始到结束排列: &#60;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243;/&#62; 让内容的宽度自适应为设备的宽度, 在做Mobile Web时必须加的一条 &#60;meta name=&#8221;format-detection&#8221; content=&#8221;telephone=no&#8221;]]&#62; 禁用手机号码链接(for iPhone) &#60;link rel=&#8221;apple-touch-icon&#8221; href=&#8221;icon.png&#8221;/&#62; 设置你网页的图标, 尺寸为57X57 px &#60;!&#8211; iOS 2.0+: tell iOS not to apply any glare effects to the icon &#8211;&#62; &#60;link rel=&#8221;apple-touch-icon-precomposed&#8221; href=&#8221;icon.png&#8221;/&#62; &#60;!&#8211; iOS 4.2+ icons for different resolutions &#8211;&#62; &#60;link rel=&#8221;apple-touch-icon&#8221; sizes=&#8221;72&#215;72&#8243; href=&#8221;touch-icon-ipad.png&#8221; /&#62; &#60;link [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用HTML5和CSS3构建基于webkit的Web Page/App" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D527&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用HTML5和CSS3构建基于webkit的Web Page/App</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WebRebuild大会演讲《揭秘HTML5和CSS3》分享" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D223&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11436352.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WebRebuild大会演讲《揭秘HTML5和CSS3》分享</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Javascript Sort" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2012/05/15/26391241.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Javascript Sort</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3实例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D497&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11435842.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3实例</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.webkit.org/" target="_blank"><img class="alignnone" src="http://gohelrakesh.files.wordpress.com/2008/08/webkit.jpg" alt="" width="527" height="382" /></a></p>
<p>前面有<a href="http://adamlu.com/?p=584" target="_blank">一篇文章</a>介绍了HTML5的一些新特性以及技巧, 现再来总结一些更多的针对webkit的HTML, CSS和Javascript方面的特性.</p>
<p><strong>HTML</strong>, 从HTML文档的开始到结束排列:</p>
<p>&lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243;/&gt; 让内容的宽度自适应为设备的宽度, 在做Mobile Web时必须加的一条</p>
<p>&lt;meta name=&#8221;format-detection&#8221; content=&#8221;telephone=no&#8221;]]&gt; 禁用手机号码链接(for iPhone)</p>
<p>&lt;link rel=&#8221;apple-touch-icon&#8221; href=&#8221;icon.png&#8221;/&gt; 设置你网页的图标, 尺寸为57X57 px</p>
<p>&lt;!&#8211; iOS 2.0+: tell iOS not to apply any glare effects to the icon &#8211;&gt;</p>
<p>&lt;link rel=&#8221;apple-touch-icon-precomposed&#8221; href=&#8221;icon.png&#8221;/&gt;</p>
<p>&lt;!&#8211; iOS 4.2+ icons for different resolutions &#8211;&gt;</p>
<p>&lt;link rel=&#8221;apple-touch-icon&#8221; sizes=&#8221;72&#215;72&#8243; href=&#8221;touch-icon-ipad.png&#8221; /&gt;</p>
<p>&lt;link rel=&#8221;apple-touch-icon&#8221; sizes=&#8221;114&#215;114&#8243; href=&#8221;touch-icon-iphone4.png&#8221; /&gt;</p>
<p>&lt;link rel=&#8221;apple-touch-startup-image&#8221; href=&#8221;startup.png&#8221;&gt; 全屏启动时候的启动画面图像, 尺寸320X460 px</p>
<p>&lt;meta name=&#8221;apple-mobile-web-app-capable&#8221; content=&#8221;yes&#8221; /&gt; 是否允许全屏显示, 只有在桌面启动时可用</p>
<p>&lt;meta name=&#8221;apple-mobile-web-app-status-bar-style&#8221; content=&#8221;black&#8221; /&gt; 控制全屏时顶部状态栏的外观, 默认白色</p>
<p>&lt;input autocorrect=&#8221;off&#8221; autocomplete=&#8221;off&#8221; autocapitalize=&#8221;off&#8221;&gt;  取消自动完成, 自动大写单词字母(适用于Mobile上)</p>
<p>&lt;input type=&#8221;text&#8221; x-webkit-speech /&gt; 语音输入</p>
<p>&lt;input type=&#8221;file&#8221; accept = &#8220;image/*; capture=camera&#8221; /&gt; 文件上传, 从相机捕获媒体, 下同</p>
<p>&lt;input type=&#8221;file&#8221; accept = &#8220;video/*; capture=camcorder&#8221; /&gt;</p>
<p>&lt;input type=&#8221;file&#8221; accept = &#8220;audio/*; capture=microphone&#8221; /&gt;</p>
<p>&lt;a href=&#8221;sms:18005555555,18005555556&#8243;]]&gt; 发送短信给多个人 的链接</p>
<p>&lt;a href=&#8221;sms:18005555555?body=Text%20goes%20here&#8221;]]&gt; 发送短信附带内容 的链接</p>
<p>&lt;a href=&#8221;tel:18005555555&#8243;]]&gt;Call us at 1-800-555-5555&lt;/a]]&gt; 拨打电话 的链接</p>
<p><strong>CSS:</strong></p>
<p>-webkit-tap-highlight-color: transparent; Mobile上点击链接高亮的时候设置颜色为透明</p>
<p>-webkit-user-select: none; 设置为无法选择文本</p>
<p>-webkit-touch-callout: none; 长按时不触发系统的菜单, 可用在图片上加这个属性禁止下载图片</p>
<p>:-webkit-full-screen canvas {} 全屏模式时的样式(for Desktop)</p>
<p>div p :matches(em, b, strong) {} 使用mathes来匹配多个选择器</p>
<p>@media only screen and (max-width: 480px) {} 指定Mobile设备或者小屏幕桌面屏幕</p>
<p>@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 300dpi) { 指定高分辨率屏幕设备</p>
<p>header { background-image: url(header-highres.png); }</p>
<p>}</p>
<p>@media (-webkit-max-device-pixel-ratio: 1.5),(max-resolution: 299dpi) { 指定低分辨率屏幕设备</p>
<p>header { background-image: url(header-lowres.png); }</p>
<p>}</p>
<p>background-repeat:  space; background-repeat: round; 这两种CSS3的背景属性值得研究</p>
<p>width: calc(100%-40px); 计算宽度</p>
<p>text-decoration: #FF8800  wavy ine-through; 波浪型链接</p>
<p><a href="http://www.aestheticallyloyal.com/public/optimize-legibility/" target="_blank">text-rendering: optimizeLegibility; </a> 用这个属性之后会收紧字符间的距离</p>
<p><a href="http://marc.baffl.co.uk/browser_bugs/css-ligatures.html" target="_blank">font-variant-ligatures:  common-ligatures</a>; 设置CSS连字</p>
<p>transform:  rotate(90); 旋转90度</p>
<p>transform-origin: center center; <a href="http://www.w3schools.com/cssref/css3_pr_transform-origin.asp" target="_blank">transform-origin</a>可以改变变换的位置</p>
<p>-webkit-appearance: none; <a href="http://trentwalton.com/2010/07/14/css-webkit-appearance/" target="_blank">-webkit-appearance</a>可以改变按钮或者其它控件看起来类似本地的控件</p>
<p>美化表单校验时的提示样式</p>
<pre class="brush:css">::-webkit-validation-bubble {}

::-webkit-validation-bubble-message {}

::-webkit-validation-bubble-arrow {}

::-webkit-validation-bubble-arrow-clipper {}</pre>
<p>当提示出现时类似于下面的结构</p>
<pre class="brush:html">&lt;div -webkit-validation-bubble&gt;

&lt;div -webkit-validation-bubble-arrow&gt;&lt;/div&gt;

&lt;div -webkit-validation-bubble-arrow-clipper&gt;&lt;/div&gt;

&lt;div -webkit-validation-bubble-message&gt;Error Message&lt;/div&gt;

&lt;/div&gt;</pre>
<p>自定义webkit浏览器的滚动条, 见Google Reader等在Chrome/Safari下的效果, 下面是一个<a href="http://css-tricks.com/examples/WebKitScrollbars/" target="_blank">实例</a>, 这个滚动条的样式代码如下:</p>
<pre class="brush:css">Customized WebKit Scrollbar /* Let´s get this party started */

::-webkit-scrollbar {

width: 12px;

}

/* Track */

::-webkit-scrollbar-track {

-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);

-webkit-border-radius: 10px;

border-radius: 10px;

}

/* Handle */

::-webkit-scrollbar-thumb {

-webkit-border-radius: 10px;

border-radius: 10px;

background: rgba(255,0,0,0.8);

-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);

}

::-webkit-scrollbar-thumb:window-inactive {

background: rgba(255,0,0,0.4);

}</pre>
<p>-webkit-background-composite: plus-darker;<a href="http://help.dottoro.com/ljktfkib.php" target="_blank"> -webkit-background-composite</a>用来设置一个元素的背景或颜色的组合样式</p>
<p>-webkit-text-stroke:  1px rgba(0,0,0,0.5); <a href="http://css-tricks.com/7405-adding-stroke-to-web-text/" target="_blank">-webkit-text-stroke</a>可以用来给文字添加描边</p>
<p><a href="http://css-tricks.com/8151-webkit-image-wipes/" target="_blank">-webkit-mask-image</a>:  url(/path/to/mask.png); 定义一个图片用来遮罩元素</p>
<p><a href="http://designshack.net/articles/css/mastering-css-reflections-in-webkit/" target="_blank">-webkit-box-reflect</a>:  below 5px; 定义了一个元素的反射</p>
<p>:local-link {font-weight: normal;}  <a href="http://www.blog.highub.com/css/whats-new-in-css-selectors-level-4/" target="_blank">local-link</a>可以定义相对地址的链接样式</p>
<p><strong>Javascript:</strong></p>
<p>window.scrollTo(0,0); 隐藏地址栏</p>
<p>window.<a href="https://developer.mozilla.org/en/DOM/window.matchMedia" target="_blank">matchMedia</a>(); 匹配媒体</p>
<p>navigator.connection; 决定手机是否运行在WiFi/3G等网络</p>
<p>window.<a href="http://menacingcloud.com/?c=highPixelDensityDisplays" target="_blank">devicePixelRatio</a>; 决定屏幕分辨率(iPhone 4值为2, 而Nexus One值为1.5)</p>
<p>window.<a href="https://developer.mozilla.org/en/DOM/window.navigator.onLine" target="_blank">navigator.onLine</a>; 取得网络连接状态</p>
<p>window.navigator.standalone; 决定iPhone是否处于全屏状态</p>
<p>touch事件 (iOS, Android 2.2+): touchstart, touchmove, touchend, touchcancel</p>
<p>gesture事件 (Apple only, iOS 2+):  gesturestart, gesturechange, gesturend give access to predefined gestures (rotation, scale, position)</p>
<pre class="brush:javascript">window.addEventListener("orientationchange", function(e){

//window.orientation(0 is portrait, 90 and -90 are landscape)

}, false);

window.addEventListener("deviceorientation", function(e){

//e.alpha

//e.beta

//e.gamma

}, false);

window.addEventListener("devicemotion", function(e){

//e.accelerationIncludingGravity.x

//e.accelerationIncludingGravity.y

//e.accelerationIncludingGravity.z

}, false);</pre>
<p><a href="http://paulirish.com/2011/requestanimationframe-for-smart-animating/" target="_blank">requestAnimationFrame</a>() 新的动画函数</p>
<p>element.<a href="https://developer.mozilla.org/en/DOM/Using_full-screen_mode" target="_blank">webkitRequestFullScreen</a>() 调用全屏函数</p>
<p>阅读更多:</p>
<p><a href="http://www.slideshare.net/franksvalli/mobile-html-css-and-javascript" target="_blank">http://www.slideshare.net/franksvalli/mobile-html-css-and-javascript</a></p>
<p><a href="http://css-tricks.com/9130-custom-scrollbars-in-webkit/" target="_blank">http://css-tricks.com/9130-custom-scrollbars-in-webkit/</a></p>
<p><a href="https://developer.mozilla.org/zh-CN/docs" target="_blank">https://developer.mozilla.org/zh-CN/docs</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="使用HTML5和CSS3构建基于webkit的Web Page/App" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D527&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">使用HTML5和CSS3构建基于webkit的Web Page/App</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="WebRebuild大会演讲《揭秘HTML5和CSS3》分享" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D223&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11436352.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">WebRebuild大会演讲《揭秘HTML5和CSS3》分享</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Javascript Sort" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D706&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2012/05/15/26391241.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Javascript Sort</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="CSS3实例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D497&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D633">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11435842.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">CSS3实例</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=633</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YUIConf 2011总结</title>
		<link>http://adamlu.com/?p=609</link>
		<comments>http://adamlu.com/?p=609#comments</comments>
		<pubDate>Fri, 25 Nov 2011 05:48:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript/DHTML]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=609</guid>
		<description><![CDATA[YUIConf 刚刚结束, 我首先看的是Luke Smith的这个&#60;class inheritance and composition in YUI&#62;以及Eric的&#60;App framework — You’ve Been Wanting This&#62;, 主要讲了YUI中怎么实现类继承以及MVC的演讲: Y.extend 实现了和原生继承一样的方式, Y.extend = function (SubClass, SuperClass, proto, static) Y.extend(SubClass, SuperClass, { someProperty: "booga!", someMethod: function(){}, },{ someStaticMethod: function(){} }); 等价于下面的代码: function SubClass() { // constructor} SubClass.prototype = new SuperClass(); SubClass.prototype.someProperty = "booga!"; SubClass.prototype.someMethod = function () { ... }; SubClass.someStaticMethod [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D389&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用YUI3组织网站结构</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Get Started with YUI</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D492&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3.3.0新特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D504&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3的Widget组件介绍</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://yuilibrary.com/yuiconf/2011/" target="_blank">YUIConf</a> 刚刚结束, 我首先看的是Luke Smith的这个&lt;class inheritance and composition in YUI&gt;以及Eric的&lt;App framework — You’ve Been Wanting This&gt;, 主要讲了YUI中怎么实现类继承以及MVC的演讲:</p>
<p><strong>Y.extend </strong>实现了和原生继承一样的方式, Y.extend = function (SubClass, SuperClass, proto, static)</p>
<pre class="brush:javascript">Y.extend(SubClass, SuperClass, {

someProperty: "booga!",
someMethod: function(){},

},{

someStaticMethod: function(){}

});</pre>
<p>等价于下面的代码:</p>
<pre class="brush:javascript">function SubClass() { // constructor}

SubClass.prototype = new SuperClass();

SubClass.prototype.someProperty = "booga!";

SubClass.prototype.someMethod = function () { ... };

SubClass.someStaticMethod = function () { ... };</pre>
<p>Y. extend好处是创建了一个&#8221;干净&#8221;的继承关系, 不需要依赖YUI其它的模块, 保证了instanceof, 通过使用SubClass.superclass来控制父类的执行; 不足是没有实现多继承, 必须通过手动运行父类构造函数来保证链式调用; 适合简单的类继承</p>
<p><strong>Y.Object</strong>, 拷贝一个新的对象</p>
<pre class="brush:javascript">Y.Object = (function () {

function F() {}

return function (obj) {

F.prototype = obj;

return new F();

};

})();</pre>
<p>Y. Object避免拷贝了过多的属性, 可以被用来构造工厂函数, 可以用来存储对象的初始值; 缺点是没有多继承, 在构造工厂函数的时候也许会产生凌乱, 在for/in循环中不能使用hasOwnProperty.</p>
<p><strong>Y.augment,</strong> <span>Y.augment = function (to, from, force, whitelist, config), </span>to &#8211; 接受者, object/constructor, from &#8211; 提供者, constructor,to为constructor时, 会把from里的prototype里的东西传给to里面的prototype, 和extend不同的是它只是增加方法, 而不会暗示继承关系, 有点像多继承, 但是不是, 看下面这个例子:</p>
<p class="p1">
<pre class="brush:javascript">YUI().use(´oop´, function(Y) {

function Foo() {}

Foo.prototype.doSomething = function () { /* something */ };

function Bar() {}

Y.augment(Bar, Foo);

var b = new Bar();

if (b instanceof Bar) {} // true

if (b instanceof Foo) {} // FALSE

});</pre>
<p class="p4">使用Y.augment的好处是延迟构造函数的执行, 可以聚合多个类的方法, 支持类/对象的聚合; 缺点是instanceof聚合的类为false, 会消耗更多的内存, 对构造函数的控制受到了限制.</p>
<p class="p4"><strong>Plugins</strong>可以让你无缝地给对象(如nodes/widgets)添加功能,</p>
<p class="p4">
<pre class="brush:javascript">Y.Plugin.Host.prototype.plug = function (Plugin, config) {

if (Plugin &amp;&amp; Plugin.NS) {

config.host = this;

this[Plugin.NS] = new Plugin(config);

}

};</pre>
<p class="p4">你也可以继承Y.Plugin.Base, 会获得更多的功能, 如对宿主的控制, 看下面的例子, 在给Widget类设计的一个Plugin里, 可以在render事件触发前改写_uiAnimSetVisible这个事件:</p>
<p class="p4">
<pre class="brush:javascript">// A plugin class designed to animate Widget´s show and hide methods.

function WidgetAnimPlugin(config) {

//...

}

WidgetAnimPlugin.NAME = ´widgetAnimPlugin´;

WidgetAnimPlugin.NS = ´fx´;

WidgetAnimPlugin.ATTRS = {

animHidden : {

//...

},

};

Y.extend(WidgetAnimPlugin, Y.Plugin.Base, {

initializer : function(config) {

// Override Widget´s _uiSetVisible method, with the custom animated method

this.beforeHostMethod("_uiSetVisible", this._uiAnimSetVisible);

},

_uiAnimSetVisible : function(show) {

// Instead of flipping visibility, use the animation

// instances configured for the plugin to animate

// hide/show.

if (this.get("host").get("rendered")) {

if (show) {

this.get("animHidden").stop();

this.get("animVisible").run();

} else {

this.get("animVisible").stop();

this.get("animHidden").run();

}

// Prevent the default method from being invoked.

return new Y.Do.Prevent();

}

}

});</pre>
<p class="p4">使用Plugin的好处是避免方法/熟悉冲突, unplug后保留了宿主的行为, 普通的Plugin可以为不同类型的宿主工作, Y.Base和Y.Nodes类的实例可以直接使用.</p>
<p class="p4"><strong>Class Extensions</strong>, 当调用这个Y.Base.create = function(NAME, SuperClass, ext, proto, static)时, 会调用构造函数, 设置属性, 运行初始化方法.</p>
<p class="p4"><strong>MVC</strong>, 在YUI中App Framework实现了MVC, 由Y.Model, Y.ModelList, Y.View, Y.Controller(将会被Y.Router代替)的一些组件构成一个MVC结构来写单页面Javascript应用程序的框架，你可以用这些组件分别和一起创建任何简单的非交互式的视图或是基于URL的进程，数据绑定或者完全客户端式的同步。</p>
<p class="p4">YUI的MVC也是学习<a href="http://documentcloud.github.com/backbone/" target="_blank">Backbone</a>这个经典的MVC框架, 如果用过<a href="http://documentcloud.github.com/backbone/" target="_blank">Backbone</a>的话所以有些东西比较熟悉, Y.Model一般用来管理数据和状态, 观察属性, 管理事件, 维护需求逻辑, 通常有数据交互这一层; Y.View就是一个渲染的容器, 一般在这里订阅事件, 比较轻量级; Y.Router是一个基本的导航管理系统, 使用了HTML5的pushState和popState(或者降级使用基于hash的历史管理), 保证url可以被收藏并且浏览器后退前进按钮可用, Y.Router的一个例子:</p>
<p class="p4">
<pre class="brush:javascript">router = new Y.Router();

router.route(/library/:lib/, function (req) {

var lib = req.params.lib;

if (lib === yui) {

Y.log(YUI Library is awesome!);

}

});

router.save(/library/yui/);// =&gt; YUI Library is awesome!</pre>
<p class="p4">Y.Router的原理图如下:</p>
<p class="p4"><img class="alignnone" src="http://images.slidesharecdn.com/appframework-better-111104181817-phpapp02-slide-18-768.jpg" alt="" width="538" height="403" /></p>
<p class="p4">Y.App是把前面三者组合起来的一个基础, 看下面的例子:</p>
<p class="p4">
<pre class="brush:javascript">var usersApp = new Y.App({ 

views: { 

users: { 

type : Y.UsersView, 

preserve: true

}, 

user: { 

type : Y.UserView, 

parent: users 

} 

}

});

var users = new Y.UsersList();

usersApp.route(´/user/´, function () { 

this.showView(users, {modelList: users});

});

usersApp.route(´/user/:id/´, function (req) { 

var user = users.getById(req.params.id); 

this.showView(user, {model: user}, function (view) { 

// Called after transition. 

});

});</pre>
<p class="p4">同时Eric还引入了一个Pjax的概念, pushState+Ajax=Pjax, 主要用来处理用户点击链接, 然后更新URL, 再去动态加载/更新内容, 它的原理图如下:</p>
<p class="p4"><img class="alignnone" src="http://images.slidesharecdn.com/appframework-better-111104181817-phpapp02-slide-43-768.jpg" alt="" width="538" height="403" /></p>
<p class="p4">重新来看Y.App的话其实它就是一个使用Pjax的View/Router, 有一个激活的View, 处理各个View的生命周期以及过渡, 在做一个App时经常使用到的一个技术是模板技术, YUI也借鉴了<a href="http://mustache.github.com/" target="_blank">Mustache</a>的优点即将引入handlebars模块, Y.Handlebars, 看一个Handlebars的模板:</p>
<p class="p4">
<p class="p4">
<p class="p4">
<pre class="brush:javascript">&lt;script id="entry-template" type="text/x-handlebars-template"&gt;

&lt;div class="entry"&gt; 

&lt;h1&gt;&lt;{{title}}&lt;/h1&gt; 

{{#if author}} 

&lt;p class="author"&gt;{{author}}&lt;/p&gt; 

{{/if}} 

&lt;div class="body"&gt;{{body}}&lt;/div&gt; 

&lt;/div&gt;

&lt;/script&gt;</pre>
<p class="p4">看看Y.Handlebars是怎么处理的:</p>
<p class="p4">
<p class="p4">
<pre class="brush:javascript">YUI().use(´handlebars´, ´node-base´, function (Y) { 

var template = Y.one(´#entry-template´).getContent(), 

render = Y.Handlebars.compile(template), 

entry = { 

title : ´The Adventures of Tom Selleck´, 

body : ´Tom crossed the river in his Ferrari…´, 

author: ´Ryan Grove´ 

}; 

Y.one(#entry).setContent(render(entry));

});</pre>
<p class="p4">有一个例子<a href="http://photosnear.me/" target="_blank">Photonearme</a>就是使用了YUI的App Framework, 同时又实现了<a href="http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/" target="_blank">响应设计</a>, 源代码请移步<a href="https://github.com/ericf/photosnear.me" target="_blank">这里</a>, YUIConf还有更精彩的内容, 待续.</p>
<p class="p4">了解更多:</p>
<p class="p4"><a href="http://yuilibrary.com/yui/docs/app/" target="_blank">http://yuilibrary.com/yui/docs/app/</a></p>
<p class="p4"><a href="https://gist.github.com/1367067" target="_blank">https://gist.github.com/1367067</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D389&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用YUI3组织网站结构</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D697&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Get Started with YUI</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D492&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3.3.0新特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D504&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D609">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI3的Widget组件介绍</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=609</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile网站性能优化</title>
		<link>http://adamlu.com/?p=597</link>
		<comments>http://adamlu.com/?p=597#comments</comments>
		<pubDate>Sun, 06 Nov 2011 16:20:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[性能]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=597</guid>
		<description><![CDATA[Twitter上看到的一个好文，关于Mobile网站性能优化的文章，http://davidbcalhoun.com/2011/mobile-performance-manifesto 现总结以下： Mobile网站的性能受到很多因素的影响: 低网速, 高延迟, 慢硬件, 不同的浏览体验, 不同的手机类型, 不同的网络. 延迟测试: ATT Edge: ~400-600ms ATT 3G: ~400ms Verizon 3G: ~150-250ms Coffee Wifi: ~75ms-200ms Home Wifi: ~25-35ms 带宽测试: ATT Edge: ~2-10kbps ATT 3G: ~60-100kbps Verizon 3G: ~20-70kbps Coffee Wifi: ~550kbps-650kbps Home Wifi: ~1000kbps-2000kbps 不同运营商的网络状况不同，就需要我们针对不同的网络选择不同的页面配置，Android 2.2以上已经支持navigator.connection，如一个3G的手机返回的结果是： {  type: 4, UNKNOWN: 0, ETHERNET: 1, WIFI: 2, CELL_2G: 3, CELL_3G: [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D482&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">跨浏览器移动网站开发(cross-browser mobile web development)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D33&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">提高网站性能最佳实践</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D522&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI Loader &amp; YLS</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" src="http://androidguys.info/wp-content/uploads/2011/09/Motorola-Edision-Atrix-2-for-ATT-performance.jpg" alt="" width="560" height="420" /></p>
<p><a href="http://twitter.com/adamlu" target="_blank">Twitter</a>上看到的一个好文，关于Mobile网站性能优化的文章，<a href="http://davidbcalhoun.com/2011/mobile-performance-manifesto" target="_blank">http://davidbcalhoun.com/2011/mobile-performance-manifesto</a></p>
<p>现总结以下：</p>
<p>Mobile网站的性能受到很多因素的影响: 低网速, 高延迟, 慢硬件, 不同的浏览体验, 不同的手机类型, 不同的网络.</p>
<p><strong>延迟测试:</strong></p>
<p>ATT Edge: ~400-600ms</p>
<p>ATT 3G: ~400ms</p>
<p>Verizon 3G: ~150-250ms</p>
<p>Coffee Wifi: ~75ms-200ms</p>
<p>Home Wifi: ~25-35ms</p>
<p><strong>带宽测试:</strong></p>
<p>ATT Edge: ~2-10kbps</p>
<p>ATT 3G: ~60-100kbps</p>
<p>Verizon 3G: ~20-70kbps</p>
<p>Coffee Wifi: ~550kbps-650kbps</p>
<p>Home Wifi: ~1000kbps-2000kbps</p>
<p>不同运营商的网络状况不同，就需要我们针对不同的网络选择不同的页面配置，Android 2.2以上已经支持navigator.connection，如一个3G的手机返回的结果是： {  type: 4, UNKNOWN: 0, ETHERNET: 1, WIFI: 2, CELL_2G: 3, CELL_3G: 4  }</p>
<p>在页面的组织上，Mobile上的Web Page尽量要减少跳转，同时也要充分利用浏览器的缓存，Feature Phone对缓存的支持比较少，而Smart Phone则可以在一个会话中比较好的缓存页面资源文件。</p>
<p><strong>避免重定向</strong></p>
<p>在服务器上设置重定向的场景，如一个url在desktop是pc的结果，而在mobile上则是mobile的结果，对于用户来说是透明的，而不是foo.com被定向到m.foo.com</p>
<p><strong>优化图片</strong></p>
<p>针对不同的设备显示不同大小的图片，通过Javascript或者CSS的Media Query来优化图片，如</p>
<p><span style="text-decoration: underline;">Javascript Example:</span></p>
<pre class="brush:javascript">window.innerHeight;       // max height actually available
window.innerWidth;        // max width actually available
window.devicePixelRatio;  // pixel density (standard is 1, high resolution is generally &gt; 1)</pre>
<p><span style="text-decoration: underline;">Media Query Example:</span></p>
<pre class="brush:css">@media only screen and (max-width: 480px) {

/* small screen styles */

}

@media only screen and (min-width: 481px) {

/* large screen styles */

}

@media (-webkit-min-device-pixel-ratio: 1.5),

(-o-min-device-pixel-ratio: 3/2),

(min--moz-device-pixel-ratio: 1.5),

(min-device-pixel-ratio: 1.5) {

/* high resolution styles */

}</pre>
<p><strong>使用Data URL来渲染图片</strong></p>
<p>可以在HTML和CSS中使用base64加密二进制图片数据，一般用来渲染小图标</p>
<p><strong>使用Unicode和<a href="http://pukupi.com/post/1964" target="_blank">Emoji</a></strong></p>
<p>☆ (HTML entity: #9734)  <img title="Emoji" src="http://davidbcalhoun.com/wp-content/uploads/2011/10/emoji3.png" alt="" width="18" height="18" />(HTML entity: #x1f468)</p>
<p>还可以使用Unicode字符和Emoji来显示一些特殊符号，不过在各个不同的浏览器和各个运营商它们的实现都不尽相同，所以可以尝试地去使用一下。</p>
<p><strong>充分利用CSS3</strong></p>
<p>很多场景下都不需要使用图片而使用CSS3就能达到一样的效果，如透明度，阴影，渐变等。</p>
<p><strong>避免使用Cookie</strong></p>
<p>使用LocalStorage/SessionStorage代替Cookie。</p>
<p><strong>使用App Cache</strong></p>
<p>如果想让你的Web App离线可以用，App Cache是一个不错的选择。</p>
<p><strong>延迟执行Javascript</strong></p>
<p>我们知道延迟加载Javascript可以提高网站的性能，同样延迟执行Javascript甚至更重要，当然你可以用defer属性，但是它只是在加载的时候有效，当加载后怎么办呢，如XHR或JSONP这样在后台的请求还是会让UI冻结住， Gmail Mobile给出的一个解决方法是Comment动态加载的脚本，当需要的时候再去eval，如：</p>
<pre class="brush:html">&lt;html&gt;

...

&lt;script id="lazy"&gt;

// Make sure you strip out (or replace) comment blocks in your JavaScript first.

/*

JavaScript of lazy module

*/

&lt;/script&gt;

&lt;script&gt;

function lazyLoad() {

var lazyElement = document.getElementById(´lazy´);

var lazyElementBody = lazyElement.innerHTML;

var jsCode = stripOutCommentBlock(lazyElementBody);

eval(jsCode);

}

&lt;/script&gt;

&lt;div onclick=lazyLoad()&gt; Lazy Load &lt;/div&gt;

&lt;/html&gt;</pre>
<p><strong>感知性能</strong></p>
<p>在任何时候都要让用户知道UI正在响应，如点击一个按钮，让用户知道他们已经点过了，如果用户点了一个可能会请求网络的东西，给他们展示一个加载的图标，即使你还没有发送那个请求。</p>
<p><strong>Onclick事件的延迟</strong></p>
<p>许多Mobile操作系统里面的onclick事件大概都有几百毫秒的延迟，解决的方法是使用touch事件。</p>
<p><strong>充分利用硬件加速</strong></p>
<p>使用硬件加速的CSS Transform(如translate3d, translateZ, rotate3d, scale3d)，这时HTML的元素就会转变为图形，这时就可以充分利用GPU的优势，而且减少了CPU的压力。但是GPU也不是万能的，所以不要对所有元素都使用硬件加速。</p>
<p><strong>HTTP Pipeling</strong></p>
<p>充分利用HTTP Pipeling，HTTP Pipeling由于用的比例不多所以经常被人们忽视，但是在Mobile上使用的比例越来越多，因为它很大程度上消除了RTTs，现在Android的很多设备和IOS5都已经支持HTTP Pipeling了，如果让你的服务器支持HTTP Pipeling，你需要添加以下两句：</p>
<p>Use of HTTP/1.1</p>
<p>An explicit “Connection: Keep-Alive” header (required by Android)</p>
<p><strong>DNS预获取</strong></p>
<p>关闭DNS预获取，使用&lt;meta http-equiv=&#8221;x-dns-prefetch-control&#8221; content=&#8221;off&#8221;&gt;，同样你也可以强制一个DNS查询</p>
<p>&lt;link rel=&#8221;dns-prefetch&#8221; href=&#8221;http://www.example.com/&#8221;&gt;</p>
<p><strong>避免脚本库臃肿</strong></p>
<p>尽量减少脚本库的使用，如Jquery Mobile(因为对于桌面版本的jquery依赖性较强)，可以使用以下新的Javascript API:</p>
<p>querySelector/querySelectorAll, getElementsByClassName, classList, XMLHttpRequest, HTML5 history, HTML5 Form Validation, HTML5 input types</p>
<p>当然你也可以考虑使用优化过的库如<a href="http://zeptojs.com/" target="_blank">Zepto.js</a>，或者某一个功能的库如<a href="http://microjs.com/" target="_blank">http://microjs.com/</a>。</p>
<p><strong>客户端数据库</strong></p>
<p>大部分Mobile浏览器支持WebSQL，但是标准逐渐会转向indexedDB，所以还是使用indexedDB为好。</p>
<p><strong>更多</strong></p>
<p>1.使用和pc上的最佳实践一样的优化方法</p>
<p>2.使用requestAnimationFrame代替setTimeout</p>
<p>3.使用setImmediate代替setTimeout(fn(){},0)</p>
<p>4.不要用过多的XHR</p>
<p>5.避免rgba, box shadows, text shadow，因为在动画的时候会影响性能</p>
<p>6.可以通过伸缩页面来提高性能</p>
<p>7.webkit的动画比javascript做的更快</p>
<p>8.如果要用javascript做动画的话，现在UI的更新最快到17ms，即相当于60fps</p>
<p><strong>更多请阅读：</strong></p>
<p><a href="http://www.slideshare.net/firt/mobile-web-html5-performance-optimization" target="_blank">http://www.slideshare.net/firt/mobile-web-html5-performance-optimization</a></p>
<p><a href="http://davidbcalhoun.com/present/mobile-performance/" target="_blank">http://davidbcalhoun.com/present/mobile-performance/</a></p>
<p><a href="http://www.html5rocks.com/en/mobile/optimization-and-performance.html" target="_blank">http://www.html5rocks.com/en/mobile/optimization-and-performance.html</a></p>
<p><a href="http://www.blaze.io/mobile/http-pipelining-big-in-mobile/" target="_blank">http://www.blaze.io/mobile/http-pipelining-big-in-mobile/</a></p>
<p><a href="http://dl.dropbox.com/u/5618867/mseeley-2011-09-27-html5devconf.pdf" target="_blank">http://dl.dropbox.com/u/5618867/mseeley-2011-09-27-html5devconf.pdf</a></p>
<p><a href="http://29a.ch/2011/5/27/fast-html5-canvas-on-iphone-mobile-safari-performance" target="_blank">http://29a.ch/2011/5/27/fast-html5-canvas-on-iphone-mobile-safari-performance</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D482&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">跨浏览器移动网站开发(cross-browser mobile web development)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D33&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">提高网站性能最佳实践</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D522&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">YUI Loader &amp; YLS</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D597">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=597</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>IOS5的Mobile Safari新特性</title>
		<link>http://adamlu.com/?p=592</link>
		<comments>http://adamlu.com/?p=592#comments</comments>
		<pubDate>Sun, 02 Oct 2011 16:14:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://adamlu.com/?p=592</guid>
		<description><![CDATA[IOS5(官方介绍)即将发布，可以说是又增加了很多新的特性，而Mobile Safari已经成为了IOS中一个很重要的特性，它也是第一个没有依赖Flash并且给手机用户带来完整的web体验的浏览器。 在IOS5刚出beta版本的时候，微软做的一个测试显示ios5的Mobile Safari对比Windows Phone7的ie和Android的浏览器性能很差，不过在后来的版本中IOS5做了很大的提高，那个测试的分数已经超过了这两个。 对于开发者来说，Mobile Safari有哪些新的特性呢? 我觉得最让我们兴奋的就是解决了position:fixed和overflow:scroll的问题。 在IOS5之前IOS不支持position:fixed，所以只能模拟这种效果，如监听body的touchmove事件，获取偏移量再计算元素的位置，可以看看Twitter的顶部条采用的就是这种方法。 同样IOS5将会提供对于overflow:scroll的支持，这样就不用通过JS的方法来模拟scroll的效果，如果浏览器原生就支持scroll，势必会对网页的性能有好处，而且也不需要像iScroll或YUI的Scrollview或是scrollability这样的优雅降级的解决方案了，同时开发者可以通过-webkit-overflow-scrolling: touch;来使用浏览器内置的滚动条。 除了上面说的两个新特性外，在HTML5方面，IOS5还增加了一些对Input的支持，如date, datatime, month, time, range的支持，还有对于Web Workers, ECMASCRIPT 5, inline SVG, float32array, int8array, int16array, int32array in JavaScript, MathML, -webkit-linear-gradient等，via http://davidbcalhoun.com/2011/new-mobile-safari-stuff-in-ios5-position-fixed-overflow-scroll-new-input-type-support-web-workers-ecmascript-5 你现在可以测试一下这些新特性了，可以通过下载IOS5的SDK或者是在Safari中设置Useragent(Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46(KHTML, like Gecko) Version/5.1 Mobile/9A5302b Safari/7534.48.3) 相信IOS5会给我们带来惊喜，native apps和web apps的区别会变得越来越模糊，他们也可以&#8221;混搭&#8221;做出兼容各个平台的app，虽然Facebook的&#8221;斯巴达&#8221;项目是为了抵制Apple，但是Apple对于web apps的确提供了很好的平台。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Debugging Mobile Web Page" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2012/01/13/13904774.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Debugging Mobile Web Page</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="HTML5 on Mobile(For Developer)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="HTML5 on Mobile (For Designer)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5 on Mobile (For Designer)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="跨浏览器移动网站开发(cross-browser mobile web development)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D482&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11435892.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">跨浏览器移动网站开发(cross-browser mobile web development)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" src="http://www.ingeeks.com/wp-content/uploads/ios5.jpg" alt="" width="540" height="270" /></p>
<p><a href="http://www.apple.com/ios/ios5/features.html" target="_blank">IOS5</a>(<a href="http://v.youku.com/v_show/id_XMjczNzU2NDMy.html" target="_blank">官方介绍</a>)即将发布，可以说是又增加了很多新的特性，而Mobile Safari已经成为了IOS中一个很重要的特性，它也是第一个没有依赖Flash并且给手机用户带来完整的web体验的浏览器。</p>
<p><span>在</span><a href="http://www.apple.com/ios/ios5/features.html" target="_blank">IOS5</a><span>刚出beta版本的时候，<a href="http://appadvice.com/appnn/2011/06/apple-improves-mobile-safari-in-ios-5-now-zooms-ahead-of-the-competition" target="_blank">微软</a>做的一个<a href="http://ie.microsoft.com/testdrive/Performance/SpeedReading/Default.html" target="_blank">测试</a>显示ios5的Mobile Safari对比Windows Phone7的ie和Android的浏览器性能很差，不过在后来的版本中</span><a href="http://www.apple.com/ios/ios5/features.html" target="_blank">IOS5</a><span>做了很大的提高，那个<a href="http://ie.microsoft.com/testdrive/Performance/SpeedReading/Default.html" target="_blank">测试</a>的分数已经超过了这两个。</span></p>
<p>对于开发者来说，Mobile Safari有哪些新的特性呢? 我觉得最让我们兴奋的就是解决了position:fixed和overflow:scroll的问题。</p>
<p><span>在</span><a href="http://www.apple.com/ios/ios5/features.html" target="_blank">IOS5</a><span>之前IOS不支持position:fixed，所以只能模拟这种效果，如监听body的touchmove事件，获取偏移量再计算元素的位置，可以看看Twitter的顶部条采用的就是这种方法。</span></p>
<p><span>同样</span><a href="http://www.apple.com/ios/ios5/features.html" target="_blank">IOS5</a><span>将会提供对于overflow:scroll的支持，这样就不用通过JS的方法来模拟scroll的效果，如果浏览器原生就支持scroll，势必会对网页的性能有好处，而且也不需要像<a href="http://cubiq.org/iscroll" target="_blank">iScroll</a>或YUI的<a href="http://yuilibrary.com/yui/docs/scrollview/" target="_blank">Scrollview</a>或是<a href="https://github.com/joehewitt/scrollability" target="_blank">scrollability</a>这样的优雅降级的解决方案了，同时开发者可以通过<span>-webkit-overflow-scrolling: touch;来使用浏览器内置的滚动条。</span></span></p>
<p><span>除了上面说的两个新特性外，在HTML5方面，</span><a href="http://www.apple.com/ios/ios5/features.html" target="_blank">IOS5</a><span>还增加了一些对Input的支持，如date, datatime, month, time, range的支持，还有对于Web Workers, ECMASCRIPT 5, inline SVG, float32array, int8array, int16array, int32array in JavaScript, MathML, -webkit-linear-gradient等，via <a href="http://davidbcalhoun.com/2011/new-mobile-safari-stuff-in-ios5-position-fixed-overflow-scroll-new-input-type-support-web-workers-ecmascript-5" target="_blank">http://davidbcalhoun.com/2011/new-mobile-safari-stuff-in-ios5-position-fixed-overflow-scroll-new-input-type-support-web-workers-ecmascript-5</a></span></p>
<p>你现在可以<a href="http://html5test.html" target="_blank">测试</a>一下这些新特性了，可以通过下载IOS5的SDK或者是在Safari中设置Useragent<strong>(</strong><strong>Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46(KHTML, like Gecko) Version/5.1 Mobile/9A5302b Safari/7534.48.3)</strong></p>
<p><span>相信</span><a href="http://www.apple.com/ios/ios5/features.html" target="_blank">IOS5</a><span>会给我们带来惊喜，native apps和web apps的区别会变得越来越模糊，他们也可以&#8221;混搭&#8221;做出兼容各个平台的app，虽然Facebook的&#8221;斯巴达&#8221;项目是为了抵制Apple，但是Apple对于web apps的确提供了很好的平台。</span></p>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://adamlu.com";
        var wumiiEnableCustomPos = false;
        var wumiiParams = "&#038;num=4&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress3.3.2";
    //--></script><script type="text/javascript" src="http://widget.wumii.com/ext/relatedItemsWidget.htm"></script><a href="http://www.wumii.com/widget/relatedItems.htm" style="border:0;"><img src="http://static.wumii.com/images/pixel.png" alt="无觅相关文章插件，快速提升流量" style="border:0;padding:0;margin:0;" /></a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Debugging Mobile Web Page" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D642&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2012/01/13/13904774.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Debugging Mobile Web Page</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="HTML5 on Mobile(For Developer)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D686&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5 on Mobile(For Developer)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="HTML5 on Mobile (For Designer)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D671&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5 on Mobile (For Designer)</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="跨浏览器移动网站开发(cross-browser mobile web development)" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fadamlu.com%2F%3Fp%3D482&from=http%3A%2F%2Fadamlu.com%2F%3Fp%3D592">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/08/11435892.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">跨浏览器移动网站开发(cross-browser mobile web development)</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://adamlu.com/?feed=rss2&#038;p=592</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

