Prototype 1.6.0 新特性

Prototype 1.6.0 released

This version of Prototype brings a number of major enhancements to the core APIs as well as the usual slew of bug fixes and performance optimizations. For the full story, see the CHANGELOG and the release notes for 1.6.0_rc0 and 1.6.0_rc1. API highlights include:

  • Ajax transport objects are now automatically wrapped in an Ajax.Response object.
  • Ajax.Response includes support for accessing JSON response bodies as JavaScript objects via the responseJSON property.
  • The class API now includes full support for inheritance and superclass method calls. (See Mislav’s tutorial for more info.)
  • Class objects now have an addMethods method for adding instance methods after creation.
  • Elements can be created easily with the new Element(...) syntax.
  • Element#insert provides a unified API to DOM element and HTML fragment insertion.
  • Element#select is an alias for getElementsBySelector and is now the preferred way to find elements by class name.
  • Element#wrap lets you easily wrap an element inside another element in place.
  • Enumerable methods on Array are now backed by native Array#forEach implementations when possible.
  • Enumerable now has aliases for equivalent JavaScript 1.6 Array methods, and support for JavaScript 1.6’s context parameter for automatic callback binding.
  • Enumerable#grep now calls the match method on its first argument, so you can use it to e.g. filter an array of DOM nodes by CSS selector.
  • Event objects are now automatically extended with instance methods, so you can write e.g. event.stop() instead of Event.stop(event).
  • Prototype’s event API now supports firing DOM-based custom events with Element#fire.
  • The new dom:loaded custom event fires when the entire document has loaded and is ready for manipulation.
  • Function#curry allows for partial application of function arguments.
  • Function#wrap facilitates simple aspect-oriented programming and provides the basis for Prototype’s superclass method call mechanism.
  • Function#delay delays invocation of the function by the given number of seconds.
  • Function#defer schedules the function to run as soon as the interpreter is idle.
  • The Hash API has changed, and you must now use Hash#get and Hash#set instead of directly accessing properties on Hash instances.
  • String#interpolate is a shortcut for instantiating a Template from the string and calling evaluate on it.
  • Object properties can now be used in template replacement strings.

script.aculo.us 1.8.0 released

script.aculo.us 1.8.0 is fully compatible with Prototype 1.6.0 and includes several improvements since the last version; see the announcement on Thomas’ blog for more details. Here’s what’s new:

  • Complete rewrite of the in-place editing controls.
  • Full CSS inheritance support for Effect.Morph.
  • Support for tweening between two values of an element property or method call with Effect.Tween.
  • A new sound API for playing interface sound effect MP3s.
  • Numerous bug fixes and performance improvements.

Prototype & script.aculo.us available in PDF

Core contributor Christophe Porteneuve’s book Prototype & script.aculo.us is now available for purchase from the Pragmatic Programmers. The “Bungee book” covers the final versions Prototype 1.6.0 and script.aculo.us 1.8.0, which is no small feat, considering many of the documented features were added in the five months since the book first went beta! You can get the final PDF instantly for $22; paper copies are $34.95 and will be shipping in the next few weeks. Every developer using Prototype and script.aculo.us will want to read this book.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值