<?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>Lab of Chowky &#187; 1.4</title>
	<atom:link href="http://lab.chowky.com/tag/1-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://lab.chowky.com</link>
	<description>分享ＩＴ技術</description>
	<lastBuildDate>Tue, 07 Sep 2010 10:48:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>[jQuery] 1.3.2 和 1.4 的比較</title>
		<link>http://lab.chowky.com/2010/01/jquery-1-3-2-%e5%92%8c-1-4-%e7%9a%84%e6%af%94%e8%bc%83/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=jquery-1-3-2-%25e5%2592%258c-1-4-%25e7%259a%2584%25e6%25af%2594%25e8%25bc%2583</link>
		<comments>http://lab.chowky.com/2010/01/jquery-1-3-2-%e5%92%8c-1-4-%e7%9a%84%e6%af%94%e8%bc%83/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 09:13:55 +0000</pubDate>
		<dc:creator>Chowky</dc:creator>
				<category><![CDATA[Jquery, Mootools]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[1.3.1]]></category>
		<category><![CDATA[1.4]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[比較]]></category>

		<guid isPermaLink="false">http://lab.chowky.com/?p=1774</guid>
		<description><![CDATA[jQuery 近來都差不多成為最多人用的javascript framework 了。 近來jQuery 推出新的release 1.4. 聽聞 performance 改善了很多。 No. of Function Calls (因為減少了很多不必要 method 的call，可能就是大大改善performance 的原因) dom 的insertion 看來需要的時間真是快了很多 (ie 系列快了很多) Performance of .html() ，重大的speed 改善 Performance of .remove() and .empty() ，很強呢~ Lets take a closest look at some useful changes * All setter method now accept a function as value: .css(), .attr(), [...]]]></description>
			<content:encoded><![CDATA[<p>jQuery 近來都差不多成為最多人用的javascript framework 了。</p>
<p>近來jQuery 推出新的release 1.4. 聽聞 performance 改善了很多。</p>
<p>No. of Function Calls (因為減少了很多不必要 method 的call，可能就是大大改善performance 的原因)<br />
<img src="http://farm5.static.flickr.com/4008/4271690739_c854c4bb83_o.png" alt="" width="614" height="461" /></p>
<p>dom 的insertion 看來需要的時間真是快了很多 (ie 系列快了很多)<br />
<img src="http://farm5.static.flickr.com/4029/4271691471_1240afd5af.jpg" alt="" /><br />
<span id="more-1774"></span><br />
Performance of .html() ，重大的speed 改善<br />
<img src="http://farm5.static.flickr.com/4037/4271691747_0cce01a33d.jpg" alt="" /></p>
<p>Performance of .remove() and .empty() ，很強呢~<br />
<img src="http://farm3.static.flickr.com/2693/4271690883_3224979b9b.jpg" alt="" /></p>
<blockquote><p>Lets take a closest look at some useful changes</p>
<p>*<br />
All setter method now accept a function as value:</p>
<p>.css(), .attr(), .val(), .html(), .text(), .append(), .prepend(), .before(), .after(),.replaceWith(), .wrap(), .wrapInner(), .offset(), .addClass(), .removeClass(), and.toggleClass().</p>
<p>$(&#8216;div.demo-container&#8217;).html(function() { var emph = &#8221; + $(&#8216;p&#8217;).length + &#8216; paragraphs!&#8217;; return &#8216;All new content for &#8216; + emph + &#8221;; });</p>
<p>*<br />
Quick Element Construction:</p>
<p>When you create a single element with the jQuery function, you can now pass in an object to add attributes and events at the same time:</p>
<p>jQuery(&#8221;</p>
<div>&#8220;, { id: &#8220;foo&#8221;, css: { height: &#8220;50px&#8221;, width: &#8220;50px&#8221;, color: &#8220;blue&#8221;, backgroundColor: &#8220;#ccc&#8221; }, click: function() { $(this).css(&#8220;backgroundColor&#8221;, &#8220;red&#8221;); } }).appendTo(&#8220;body&#8221;);</p>
<p>* Event Multi-binding:<br />
You can now pass an object of many events to bind to an element:</p>
<p>$(&#8220;div.test&#8221;).bind({ click: function(){ $(this).addClass(&#8220;active&#8221;); }, mouseenter: function(){ $(this).addClass(&#8220;inside&#8221;); }, mouseleave: function(){ $(this).removeClass(&#8220;inside&#8221;); } });</p>
<p>* All Events Can Be Live Events:<br />
Has been introduced cross-browser support for change, submit, focusin, focusout, mouseenter, and mouseleave via the event delegation in .live(). Note that if you need a live focus event, you should use focusin and focusout rather than focus and blur, because focus and blur do not bubble. Also, live() also now accepts a data object, just as bind() has:</p>
<p>$(&#8220;p&#8221;).live(&#8220;myCustomEvent&#8221;, function(e, myName, myValue){ $(this).text(&#8220;Hi there!&#8221;); $(&#8220;span&#8221;).stop().css(&#8220;opacity&#8221;, 1) .text(&#8220;myName = &#8221; + myName) .fadeIn(30).fadeOut(1000); }); $(&#8220;button&#8221;).click(function () { $(&#8220;p&#8221;).trigger(&#8220;myCustomEvent&#8221;); });</p>
<p>* before, after, replaceWith on disconnected nodes:<br />
You can now use before, after, and replaceWith on nodes that are not attached to the DOM. This allows you to do more complex manipulations before inserting the final structure into the DOM.</p>
<p>jQuery(&#8221; &#8220;).before(&#8220;Hello&#8221;).appendTo(&#8220;body&#8221;)</p>
<p>* .offset( coords | Function )<br />
It is now possible to set the offset of an element. Offset, like all setter methods, can now also accept a function as a second argument.</p>
<p>$(MyEl).offset({ top: 10, left: 30 });</p>
<p>* New .delay() method:<br />
The .delay() method will delay any further elements in the queue for the specified number of milliseconds.</p>
<p>$(&#8220;div&#8221;).fadeIn().delay(4000).fadeOut();</p>
</div>
</blockquote>
<p>developer 當然會擔心，update 了之後會有問題。<br />
但~其實只有很少的地方是incompatible 已而~</p>
<blockquote><p>* .add() no longer plainly concatenates the results together, the results are merged and then sorted in document order.<br />
* .clone(true) now copies events AND data instead of just events.<br />
* jQuery.data(elem) no longer returns an id, it returns the element’s object cache instead.<br />
* jQuery() (with no arguments) no longer converts to jQuery(document).<br />
* .val(“…”) on an option or a checkbox is no longer ambiguous (it will always select by value now, not by text value).<br />
* jQuery.browser.version now returns engine version.<br />
* jQuery is now strict about incoming JSON and throw an exception if we get malformed JSON. If you need to be able to evaluate malformed JSON that is valid JavaScript, you can make a text request and use eval() to evaluate the contents.<br />
* Param serialization now happens in the PHP/Rails style by default. You can use jQuery.ajaxSettings.traditional = true; to use traditional parameter serialization. You can also set the behavior on a per-request basis by passing traditional: true to the jQuery.ajax method.<br />
* jQuery.extend(true, …) No longer extends non-plain-objects or arrays.<br />
* If an Ajax request is made without specifying a dataType and it is returned as text/javascript, it will be executed. Previously, an explicit dataType was required.<br />
* Setting an Ajax request’s ifModified now takes ETags into consideration.</p></blockquote>
<p>Source: <a href="http://blog.skitsanos.com/2010/01/what-is-new-in-jquery-14-features-for.html">http://blog.skitsanos.com/2010/01/what-is-new-in-jquery-14-features-for.html</a></p>
 <img src="http://lab.chowky.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1774" width="1" height="1" style="display: none;" /><p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://lab.chowky.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://lab.chowky.com/2010/01/jquery-1-3-2-%e5%92%8c-1-4-%e7%9a%84%e6%af%94%e8%bc%83/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
