jQuery 1.4 正式版公布

jQuery 1.4 正式版发布
jQuery 1.4 除了增加大量的 API 以外 (參考「Version 1.4 – jQuery API」這個網頁的列表),又再次大幅改善效能 (這是重點,可以看到整篇介紹文章有一大半都是講效能的改進)。這些效能改進的方式有些在 John Resig 的 blog 有專門寫文章解釋過,像是「JavaScript Function Call Profiling」。

另外,jQuery.param() 支援 serialization 了… 可以把 js object 轉成像 foo[]=bar&foo[]=baz 這樣的字串,讓 web 端處理起來比較方便,不用特地丟 JSON object 進去再用 JSON decoder 解開。而 jQuery.JSONP 也終於可以指定 callback name 了

jQuery 1.4 的新特性:

•Easy Setter Functions: For a while now, you’ve been able to pass a function into .attr() and the return value of that function is set into the appropriate attribute. This functionalilty has now been extended into all setter methods
•Ajax: A lot of enhancements to the various remoting functions including support for native JSON parsing, etags, request context, and more
•改进了 .css 和 .attr 方法
•Per property easing on effects
•If you want to ensure that “this” inside a function will be permanently bound to a particular value, you can use jQuery.proxy to return a new function with that scope
•增加新的事件:focusin 和 focusout
下载地址:http://code.jquery.com/jquery-1.4.min.js