<?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>Xu Design &#187; JavaScript</title>
	<atom:link href="http://xuui.net/tag/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://xuui.net</link>
	<description>专注和分享界面设计的点点滴滴.</description>
	<lastBuildDate>Sat, 28 Jan 2012 01:04:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>最短的 IE 判定</title>
		<link>http://xuui.net/librarys/ie_detection_in_5_bytes.html</link>
		<comments>http://xuui.net/librarys/ie_detection_in_5_bytes.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 02:42:24 +0000</pubDate>
		<dc:creator>Xu.hel</dc:creator>
				<category><![CDATA[Librarys]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://xuui.net/?p=1385</guid>
		<description><![CDATA[这是一个利用IE与标准浏览器在处理数组的toString方法的差异做成的判断，可是IE 的一个 Bug 吧。 现在这个 JavaScript 代码仅仅只需要6 bytes! var ie = !-[1,] var ie = !-[1,]; alert(ie); 如果从非IE的角度判定，可以省一个比特，因为我们做兼容时，绝大多数情况都是IE与非IE地开工。 var notIE &#8230; <a href="http://xuui.net/librarys/ie_detection_in_5_bytes.html" class="more-link">了解更多</a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" src="http://xuui.net/wp-content/uploads/code.png" alt="" /></p>
<p>这是一个利用IE与标准浏览器在处理数组的toString方法的差异做成的判断，可是IE 的一个 Bug 吧。</p>
<p><span id="more-1385"></span>现在这个 JavaScript 代码仅仅只需要6 bytes!</p>
<blockquote><p>var ie = !-[1,]</p></blockquote>
<p><code>var ie = !-[1,];<br />
alert(ie);</code></p>
<p>如果从非IE的角度判定，可以省一个比特，因为我们做兼容时，绝大多数情况都是IE与非IE地开工。</p>
<blockquote><p>var notIE = -[1,]</p></blockquote>
<p><code>if(-[1,]){<br />
 alert("这不是IE浏览器！");<br />
}else{<br />
 alert("这是IE浏览器！");<br />
}</code></p>
<p>(<a href="http://leeiio.me/ie_detection_in_5_bytes/">Via</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://xuui.net/librarys/ie_detection_in_5_bytes.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

