欲穷千里目 更上一层楼 海内存知己 天涯若比邻
Prototype 1.6.0及script.aculo.us 1.8.0特征备忘录
上一篇 /
下一篇 2008-10-31 07:18:51
/ 个人分类:Prototype
Prototype 1.6.0及script.aculo.us 1.8.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 theCHANGELOGand the release notes for1.6.0_rc0and1.6.0_rc1.APIhighlights include:
- Ajax transport objects are now automatically wrapped in anAjax.Responseobject.
- Ajax.Responseincludes support for accessingJSONresponse bodies as JavaScript. objects via theresponseJSONproperty.
- The classAPInow includes full support for inheritance and superclass method calls. (SeeMislav’s tutorialfor more info.)
- Class objects now have anaddMethodsmethod for adding instance methods after creation.
- Elements can be created easily with thenew Element(...)syntax.
- Element#insertprovides a unifiedAPItoDOMelement andHTMLfragment insertion.
- Element#selectis an alias forgetElementsBySelectorand is now the preferred way to find elements by class name.
- Element#wraplets you easily wrap an element inside another element in place.
- Enumerablemethods onArrayare now backed by nativeArray#forEachimplementations when possible.
- Enumerablenow has aliases for equivalent JavaScript. 1.6Arraymethods, and support for JavaScript. 1.6’s context parameter for automatic callback binding.
- Enumerable#grepnow calls the match method on its first argument, so you can use it to e.g. filter an array ofDOMnodes byCSSselector.
- Event objects are now automatically extended with instance methods, so you can write e.g.event.stop()instead ofEvent.stop(event).
- Prototype’s eventAPInow supports firingDOM-based custom events withElement#fire.
- The newdom:loadedcustom event fires when the entire document has loaded and is ready for manipulation.
- Function#curryallows for partial application of function arguments.
- Function#wrapfacilitates simple aspect-oriented programming and provides the basis for Prototype’s superclass method call mechanism.
- Function#delaydelays invocation of the function by the given number of seconds.
- Function#deferschedules the function to run as soon as the interpreter is idle.
- TheHashAPI has changed, and you must now useHash#getandHash#setinstead of directly accessing properties onHashinstances.
- String#interpolateis a shortcut for instantiating aTemplatefrom the string and callingevaluateon 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 theannouncement on Thomas’ blogfor more details. Here’s what’s new:
- Complete rewrite of the in-place editing controls.
- FullCSSinheritance support forEffect.Morph.
- Support for tweening between two values of an element property or method call withEffect.Tween.
- A new soundAPIfor playing interface sound effect MP3s.
- Numerous bug fixes and performance improvements.
导入论坛
引用链接
收藏
分享给好友
推荐到圈子
管理
举报
TAG:
prototype