I have written a utility function which expects the window object to work on.
function someFunc(windowObj) { windowObj.someOtherFunc(); }
Now, I want to call this function onclick of a hyperlink, but the following code does not send the window object.
<a href='#' onclick='someFunc(this.window)'>Test</a>
and this doesn’t work either:
<a href='#' onclick='someFunc(this)'>Test</a>
I understand in the latter case, this refers to the html anchor element itself.
Any thoughts how this can be done?
The window object is a global object which is referred to without the ‘this’ pointer.
Try
instead and see if that works better.