首页 > web前端 > js教程 > 正文

DOMAssitant最新版 DOMAssistant 2.5发布_js面向对象

php中文网
发布: 2016-05-16 19:07:04
原创
1269人浏览过

一个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版包含的新特性:
Full CSS1-3 selector support   完全的CSS1-3选择器支持
New AJAX methods: load and get  新增的load和get方法
Enhanced performance and extra checks for memory leaks 增强的性能和额外的内存泄露的检测
XPath Support Xpath选择器支持
DOMAssistant now creates its own scope to make use of private properties  创建了自己运行域保护自身的所有属性
Also, in terms of code quality Robert has taken the extra step to ensure that the whole library is JSLint validated.
此外,为保证代码质量,整个代码库通过了JSLint的验证,


The main purpose of DOMAssistant is to provide a solid foundation to build upon without all of the extras sometimes included in other libraries. As such, DOMAssistant focuses on:
DomAssistant的主要目的在于提供一个不依赖任何第三方类库的基础类库,DomAssistant专注于一下特性:

Element selection (through CSS selectors or enhanced methods).  元素选择(通过CSS选择器或更强大的选择方法)
CSS handling (adding and removing CSS classes).  CSS属性操作(添加或删除CSS Class)
Event handling (adding and removing events).  事件操作 (添加删除事件)
Content manipulation (add or remove elements).  页面内容操作(添加删除页面元素)

AJAX interaction (getting content from other sources, and adding it to the document).
Ajax交互 (从外部获取内容并添加到页面指定位置)

DOM loaded (calling functions when the DOM is loaded, as opposed to the document with all dependencies).
DOM加载完成 (当页面DOM加载完成后回调一个函数,而不是等待页面内容加载完毕)

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号