作为标题,我可以在辣椒插件 API 中添加自定义函数吗?
自定义函数可以返回值吗?
像这样
HelloTutorialModule = document.getElementById('hello_tutorial');
var errorCode;
errorCode = HelloTutorialModule.myCustomFunction('Hello');
谢谢
作为标题,我可以在辣椒插件 API 中添加自定义函数吗?
自定义函数可以返回值吗?
像这样
HelloTutorialModule = document.getElementById('hello_tutorial');
var errorCode;
errorCode = HelloTutorialModule.myCustomFunction('Hello');
谢谢
是的,你可以,因为document.getElementById
会返回一个Object
,如果不是,你可以增强这个对象freeze
。
请参考我的DEMO