简体   繁体   中英

How to implement a new layer over JavaScript framework?

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

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

For example...

MyLibrary = MyLibrary || {};

MyLibrary.animate = function(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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM