Possible Duplicate:
If Javascript has first-class functions, why doesn’t this work?別名功能的JavaScript
當我嘗試做一個別名功能document.getElementById
如下:
f = document.getElementById;
但是,當我嘗試撥打:
var e_fullname = f(「fullname」);
有人惜售錯誤:Could not convert JavaScript argument
而且下面是OK:
var e_fullname = f.call(document, 「funname」);
你能告訴我爲什麼嗎?
你有一些不尋常的報價。你在用什麼編輯器? – 0x499602D2
@David真正的程序員使用Word –
我不認爲這個問題是因爲編輯器。我只是想了解Javascript是如何工作的? – vietean