谁能解释为什么第一件事有效而第二件事无效?
function MyObj(val) {
this.value = val;
this.myFunc = function(selector) {
$(selector).html("test: " + this.value);
}
}
foo = new MyObj("tester");
foo.myFunc("#one"); //This works
func = foo.myFunc;
func("#two"); //This doesnt
如何?我怎样才能让它工作?