zl程序教程

您现在的位置是:首页 >  其它

当前栏目

DOMAssitant最新版DOMAssistant2.5发布

发布 最新版
2023-06-13 09:13:59 时间
一个google code上的project
刚发布了2.5版
号称又要做一个大而全的js的库,要和jQuery, prototype, YUI, Ext对抗的,哈哈
With this release of DOMAssistant, I feel that it can seriously compete
with the major JavaScript libraries on the market. It has a very easy
syntax to select or manipulate elements, and with the core
functionality anyone needs, without having to worry about web browser
differences
简单看了一下语法,其实他能做的YUI应该基本也都能做,不过Enhanced performance and extra checks for memory leaks这个ms比较强,有空看一看。
其次,它有一些比较方便的语法,Selector使用的CSS和XPath的语法肯定比YUI的YAHOO.util.get然后再getElementsByClassName之类的效率高(另:新版的YUI也已经发布了Selector),另外同样做一次Ajax请求,它有最常用的get和load方法,取得数据和找到并更新一个元素的内容可以在一行代码之内完成,而用YUI来做这个事情,可能需要10行代码吧,anyway,大不了自己包装YUI的时候再写个最最常用的load和get方法好了,细节的方法还是需要的,毕竟不是所有的请求都是get和load这么简单的处理。

作者站点:http://www.robertnyman.com/
详细介绍:http://www.robertnyman.com/2007/12/17/domassistant-25-released-css-selector-support-new-ajax-methods-and-more-goodies-added/

2.5版包含的新特性:
FullCSS1-3selectorsupport  完全的CSS1-3选择器支持
NewAJAXmethods:loadandget  新增的load和get方法
Enhancedperformanceandextrachecksformemoryleaks增强的性能和额外的内存泄露的检测
XPathSupportXpath选择器支持
DOMAssistantnowcreatesitsownscopetomakeuseofprivateproperties  创建了自己运行域保护自身的所有属性
Also,intermsofcodequalityRoberthastakentheextrasteptoensurethatthewholelibraryisJSLintvalidated.
此外,为保证代码质量,整个代码库通过了JSLint的验证,


ThemainpurposeofDOMAssistantistoprovideasolidfoundationtobuilduponwithoutalloftheextrassometimesincludedinotherlibraries.Assuch,DOMAssistantfocuseson:
DomAssistant的主要目的在于提供一个不依赖任何第三方类库的基础类库,DomAssistant专注于一下特性:

Elementselection(throughCSSselectorsorenhancedmethods).  元素选择(通过CSS选择器或更强大的选择方法)
CSShandling(addingandremovingCSSclasses).  CSS属性操作(添加或删除CSSClass)
Eventhandling(addingandremovingevents).  事件操作(添加删除事件)
Contentmanipulation(addorremoveelements).  页面内容操作(添加删除页面元素)

AJAXinteraction(gettingcontentfromothersources,andaddingittothedocument).
Ajax交互(从外部获取内容并添加到页面指定位置)

DOMloaded(callingfunctionswhentheDOMisloaded,asopposedtothedocumentwithalldependencies).
DOM加载完成(当页面DOM加载完成后回调一个函数,而不是等待页面内容加载完毕)