You are not logged in.

#1 2005-10-03 23:33:43

everknown
Member
Registered: 2005-10-03
Posts: 1

contentWindow is null or not an object

Script works fine in Mozilla but on IE 6.0 I get these errors:

Access is denied
Line: 12
Char 38709
------

contentWindow is null or not an object
Line: 10
Char: 15423

I've seen some reports of this access id denied error so i tried lowering the security on IE, and that didn't fix it....i'm doing this with Lotus Notes. My notes server is dbqp01.domain.com, and the IIS server with these files is dbiis.domain.com.....would this be causing the problem? cross domain? i can't very easily put .JS files on the Notes server.

Anyone have a suggestion for me? thanks in advance.

Offline

 

#2 2005-10-31 13:13:24

ianaturner
Member
From: UK
Registered: 2005-10-31
Posts: 4

Re: contentWindow is null or not an object

I have the same problem...

Using IE 6.0, with tiny_mce_src.js I get these errors...

Access is denied
Line:
Char:

Having a poke around in the source, the error seems to stem from an error in the else condition of the if (tinyMCE.isOpera) test in TinyMCEControl.prototype.onAdd

            if (tinyMCE.isOpera) {
                this.contentDocument = this.iframeElement.contentDocument;
                this.contentWindow = this.iframeElement.contentWindow;
                dynamicIFrame = true;
            } else {
here >>>          this.contentDocument = tElm.window.document;
                this.contentWindow = tElm.window;
            }

window is a valid object here, but the attempt to assign from window.document is invalid


However, unlike the previous poster, this is all within the localhost domain.

Works fine in Firefox.

Any suggestions please? I simply can't get TinyMCE to work.

Offline

 

#3 2005-10-31 13:51:22

spocke
Administrator
From: Sweden, Skellefteċ
Registered: 2004-11-25
Posts: 11253
Website

Re: contentWindow is null or not an object

Yes, the javascript files and the page must be located on the same domain and port number and even protocol. MSIE doesn't like cross domain scripting so it's probably why it fails.


Best regards,
Spocke - Main developer of TinyMCE

Offline

 

#4 2005-10-31 14:43:38

ianaturner
Member
From: UK
Registered: 2005-10-31
Posts: 4

Re: contentWindow is null or not an object

I figured mine out... I'm using XMLSpy to generate my HTML from XSLT, and this requires a <base href...> in order to test the transformations within XMLSpy using IE embedded in the IDE.

And yes, I am accessing multiple websites within my localhost, to provide other features on the page.

Remove the <base> tag and test on a saved file in IE, and all is well.

smile

Last edited by ianaturner (2005-10-31 14:44:34)

Offline

 

#5 2006-11-09 17:32:56

fsec
Member
Registered: 2006-11-08
Posts: 4

Re: contentWindow is null or not an object

Hi,
i'm also getting the same error. I can't put the javascript files in the same domain as my pages are pl/sql pages and they load from oracle. Works fine in firefox but not in IE.
What you mean by remove <base> tag. From where?????
this is the link to my page.
http://dbase.fsec.ucf.edu/pls/egflacom/demo

Any help will be appreciated.

Offline

 

#6 2007-03-02 05:11:07

krusty76
Member
Registered: 2006-08-10
Posts: 87

Re: contentWindow is null or not an object

*bump*

We are having a serious issue with this problem right now.  While I realize this is not TinyMCE's fault, I am hoping someone can come up with a solution.  Basically we have a page where we render the user's page as it resides on our server, so we add a BASE tag with an HREF pointing to their production server so that any relative URLs on the page are resolved properly.  We recently began developing an extension to our product so that the users can edit portions of this page directly / inline.  Needless to say, it all worked just as expected in Fx (both 1.5.x and 2.0.x).  Then we went to attempt it in IE and were surprised to find that it was rejecting the TinyMCE code with a generic "Access is denied" message.  After many hours of trial and error, we discovered that the BASE tag was the culprit.

The oddest this about this discovery is that the page in question is being served from the same domain as the javascript.  The BASE tag is only being used to allow it to load resources with relative URLs.  Why in the world would you not TRUST the original site?!  If you are loading the page from them, they could have omitted the BASE tag entirely and had their way with the rest of the page.  Just seems plain idiotic.

If anyone has some bright idea for working around this, please feel free to contact me directly.  ted [at] omniupdate [dot] com.  Any help would obviously be greatly appreciated.

Thanks.

P.S.  Just to clarify.  The user is loading a page from our-domain.com, but their resources are located on their-domain.com.  So, the page being served from our-domain.com includes a base tag like this:

Code:

<base href="their-domain.com" />

Then we also have Tiny being loaded from our-domain.com, using an absolute URL.

P.P.S.  The first portion of Tiny that creates a complaint is in the Context Menu plugin.  There is a line in there that creates a popup window in IE only.  When it tries to access the new popup window's document, that's when IE complains.  In my current copy of contextmenu/editor_plugin_src.js it occurs on line 251 and looks like this:

Code:

        doc = this.pop.document;

Offline

 

#7 2007-03-02 10:56:37

Zappino
Member
Registered: 2006-04-26
Posts: 23

Re: contentWindow is null or not an object

Hi krusty76,

at first you should try to use the simple theme. If you get this running, go on with the advanced theme but add one plugin after another. In your case you might not be able to get a 100% percent version of TinyMCE but maybe you will get 80-90%.

Especially the contextmenu plugin is a javascript only file which writes HTML Code to a new popup window (an iframe popup). Maybe you have to modify this HTML code in that way that it has the <base href="their-domain.com" /> tag either.

The other main aspect is, where is the code line "<base href="their-domain.com" />" placed?. Do you do it before or after initializing TinyMCE?


Greetz Zappino

Offline

 

#8 2007-03-02 12:04:37

krusty76
Member
Registered: 2006-08-10
Posts: 87

Re: contentWindow is null or not an object

Zappino.

Thanks for your quick reply.  I appreciate your suggestions, but I'm not sure I'm too excited about cutting out functionality to make IE behave as it should.  I mean, as a last resort I may have to do something like that, but our customers are used to a certain level of functionality with respect to Tiny on our site.  This new problem is preventing that same level of functionality in this new scenario.

As far as the BASE tag and where it appears -- I tried moving it around and have even begun trying to add it programmatically via javascript to see if that will help.  Moving it didn't do anything.  I also don't have high hopes for the javascript adding the BASE tag itself.  But I will try it and report back to here with my findings.

Most of all, I am just disappointed with IE's continued lack of ... how should we say ... logic.  Or maybe, fundamentals.  Or possibly even responsibility to the web developer community.  I mean, how many hours have people wasted since 1995 trying to fix crap that should work in IE but doesn't?!  I think Bill Gates should have to dig deep into his pockets and pay us all back for stealing 100s or even 1000s of hours of our lives.

</rant>

Again, thanks for your response.  Hopefully someone that has some insight as to the internals of IE can develop some sort of hacky workaround.  Or even a sure fire way to emulate the BASE functionality using javascript.  At this point, I'd take just about anything.

By the way, this breaks in IE7 as well as IE6.

Regards,
Ted

Offline

 

#9 2007-03-02 13:44:56

Zappino
Member
Registered: 2006-04-26
Posts: 23

Re: contentWindow is null or not an object

Hi krusty,

if you are trying to add the BASE tag via javascript, you should add it in the oninit or onpageload Method function. In this case the BASE tag will be added after or directly before the initialization of TinyMCE.
Take a look at these links as an example:
http://wiki.moxiecode.com/index.php/Tin … ion/oninit
http://wiki.moxiecode.com/index.php/Tin … onpageload


Greetz Zappino

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB