jQuery - 透過proxy將其它物件帶入特定function 2017-05-12
var me = {
type: 'zombie',
test: function(event) {
var element = event.target;
console.log(`Hello ${this.type}
`);
};
$('#text').on('click', $.proxy(me.test, me));
此方法可以將私有function帶入外部參數,
進階用法請參考https://api.jquery.com/jQuery.proxy/