var test = {
demo: function(){
//get the caller context here
}
}
//when this gets called, the caller context should be window.
test.demo();
ho cercato arguments.callee
e arguments.callee.caller
, e senza fortuna ...È possibile ottenere il contesto del chiamante in javascript?
Cosa intendi per "contesto del chiamante"? Forse intendi il valore della sua * questa * parola chiave? – RobG
@ RobG, nel mio esempio, dovrebbe essere 'window', effectually' this' keyword nel sito di chiamata. –
test.demo.call (finestra); – cycaHuH