これは簡易版です。
私がこのようなことをすると:
var object = [{name:"bob", type:"silly", hair:"brown", func:someFunction},
{name:"greg", type:"serious", hair:"blonde", func: differentFunction}];
$('#thing').bind("click", object[0], handleTranslator);
function handleTranslator(e){
$([e.data.func]);
}
function someFunction(){
console.log("clicking bob should trigger this function");
}
function differentFunction(){
console.log("clicking greg should trigger this function");
}
#thing をクリックすると、トリガーされるはずですsomeFunction
が、トリガーされません。理由がわからない。
理想的には、(console.log) my object[0] 内部からも確認できるようにしたいと考えていますsomeFunction
。
助けてくれてありがとう。