简体   繁体   English

如何在Pepper插件API中添加自定义功能

[英]How to add custom function in pepper plugin API

As title, can I add a custom function in pepper plugin API? 作为标题,我可以在Pepper插件API中添加自定义函数吗?

Can the custom function return a value? 定制函数可以返回值吗?

like this 像这样

HelloTutorialModule = document.getElementById('hello_tutorial');
var errorCode;
errorCode = HelloTutorialModule.myCustomFunction('Hello');

Thanks 谢谢

yes, you can, because document.getElementById will return an Object , you can enhance this object if it is not freeze . 是的,您可以,因为document.getElementById将返回一个Object ,所以可以增强该对象(如果未freeze

Please refer to my DEMO 请参考我的演示

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

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