I have a two windows, one is opened from another, so, I have an opener
property in "child" window.
Parent window has some function in global scope, which must be called with a function as a first argument (it will be used as a callback).
Both pages are opened from same domain, so, I haven't any Same Origin Policy restrictions (I hope so)...
In a child window I have code like this
if(window.opener) {
window.opener.myFunction(function() { ... });
}
Everything works fine, until I try to run it in IE. In this browser an argument, received by myFunction
, is ALWAYS of type Object
(checked with typeof
). Code of myFunction
is something like this:
window.myFunction = function(cb) {
alert('Callback type is ' + (typeof cb));
if(typeof cb == 'function')
cb();
else
alert('Not a function!');
}
Live demo: http://elifantiev.ru/ie-opener-issue/first.html
The questions is:
- is this a standarts compliant behaviour?
- is there some workaround for this issue?