开发者

How to implement a new layer over JavaScript framework?

开发者 https://www.devze.com 2023-01-22 20:01 出处:网络
What\'s the best way to implement a new layer over JavaScript framework (jQuery, Prototype, ...)? +------------+

What's the best way to implement a new layer over JavaScript framework (jQuery, Prototype, ...)?

+------------+
| JavaScript |
+------------+
|   jQuery   |
+------------+
|  MyLibrary |
+------------+

For example...

MyLibrary = MyLibrary || {};

MyLibrary.animate = funct开发者_开发技巧ion(params) {
   // some code
}

MyLibrary.insert = function(params) {
   // some code
}

Execution

MyLibrary.animate(params);

Thanks for reply!


Why not just extend jQuery, with plugins, to do what you want. Attempting to wrap the entire jQuery library would seem to be a lot of work just to add some functions.

0

精彩评论

暂无评论...
验证码 换一张
取 消