Window.opener undefined in IE8?

I can’t understand where I am going wrong. In other browsers, it works fine:

function main__pageeditor_new_body_SetUrl()
    {
        function getUrlParam(parentObject, paramName)
        {
          var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i') ;            
          var match = parentObject.location.search.match(reParam) ;

           return (match && match.length > 1) ? match[1] : '' ;
        }

        var funcNum = getUrlParam(this, 'CKEditorFuncNum');

        this.opener.CKEDITOR.tools.callFunction(funcNum, arguments[0]);
}

But in IE you get this error:

'this.opener.CKEDITOR' is null or not an object

Why is this not working?

+5
source share
7 answers

window.opener does not always work in IE8 for security reasons. I think you can place sites in the "trusted zone" so that it can work window.opener.

If two windows are in different domains, it will not work in any browser due to the same origin policy.

0
source

, , NULL??

this.opener
or
this.opener.CKEDITOR
0

window.opener , "" IE8. Window Opener

CKEDITOR, CKEDITOR DEMO

window.open , , .

>>String(this.opener.CKEDITOR.tools.callFunction);

"function(f){var g=e[f];return g&&g.apply(window,Array.prototype.slice.call(arguments,1));}"

, , .

0

: http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/0c014e78-8d35-4df3-93da-7f6a30b4ed8b/

:

"" " -". " " Internet Explorer.

, , :

" "... , , , (). "" > "" IE, , /.

, , , , , , . reset .

0
source

I ran into a window.opener problem that got null in my web application running at http: / localhost: 8080. If I put the IP address / hostname instead of localhost, this problem will not occur.

Lets check, I firmly believe that this solution is useful.

0
source

The context of this can be changed depending on how you use this function.

change:

this.opener.CKEDITOR.tools.callFunction(funcNum, arguments[0]);

at

window.opener.CKEDITOR.tools.callFunction(funcNum, arguments[0]);

Does it fix?

-1
source

All Articles