How to implement a new layer over JavaScript framework?
-
26-09-2019 - |
Question
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!
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow