I have a JS function which I sometimes want to invoke in the context of the main window, and sometimes in the client window. Something like the following:
var f = function() { alert(window.location); };
f(); // should show the location of the parent frame
// DOESN'T WORK, but is intended to show the location of the first IFrame
f.call(window.frames[0]);
Googling this mostly shows me how to invoke a function which is defined in the child frame. I, however, want to take a function which is defined in the parent and execute it in the child frame. And, to eliminate the obvious, adding a window parameter to the function is not a viable option.