【发布时间】:2019-06-28 21:21:22
【问题描述】:
通常我可以在 vanilla js 中做类似的事情(我可以使用数组来管理多个订阅)。
window.doCensorship = function($value, $proposal){return true};
function canPublish(text){
var returnValue = (/* free speech */ true);
if (typeof window.doCensorship === "function") {
returnValue = window.doCensorship(text, returnValue);
}
return returnValue;
}
}
但从我所见,JQuery 似乎没有从自定义事件回调中获取值的概念......
我错过了一些文档吗?我怎样才能在 JQuery 中做到这一点?
【问题讨论】:
标签: javascript jquery events callback event-handling