简体   繁体   English

如何扩展JavaScript库?

[英]how to extend a javascript library?

I am new to programming and I want to know if I can expand a library of javascript and override methods? 我是编程新手,我想知道我是否可以扩展javascript库并覆盖方法?

Suppose we have installed library dropzone. 假设我们已经安装了库dropzone。 we can extend it and override methods? 我们可以扩展它并覆盖方法吗?

Thanks in advance! 提前致谢!

Yes, you can. 是的你可以。

I do normally change the functions in the library itself. 我通常会更改库本身的功能。 This does of course only work if you have installed the library locally and you do want to have the method changed in all your code. 这当然只有在本地安装了库并且您希望在所有代码中更改了方法时才有效。

If you still need to access the original function, or other people will also read your code, then take a look at this similar question here . 如果您仍然需要访问原始功能,或者其他人也会阅读您的代码,请在此处查看此类似问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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