Possible Duplicate:
If Javascript has first-class functions, why doesn’t this work?funzione di Alias in javascript
Quando provo a fare una funzione di alias per document.getElementById
come di seguito:
f = document.getElementById;
Ma, quando provo a chiamare:
var e_fullname = f(“fullname”);
È stato rizzati un errore: Could not convert JavaScript argument
E qui sotto è OK:
var e_fullname = f.call(document, “funname”);
Puoi dirmi perché?
avete un po 'insolite citazioni. Che editor stai usando? – 0x499602D2
@ I programmatori reali di David usano Word –
Non credo questo problema perché un editor. Devo solo capire come funziona Javascript? – vietean