2

folling this discussion and this link, I learnt that by adding document.domain = 'mydomain.com'; to the tinyMCE initializer file and tiny_mce_popup.js i can overcome the cross domain problem.

I haven't tested it on a proper production server, but in my dev environment the base domain is localhost:8000 and my static files (also tinyMCE ones) are on localhost:88.

Adding document.domain = 'localhost:8000'; or document.domain = 'localhost:88'; doesn't solve the problem as I get the following error:

Uncaught Error: SECURITY_ERR: DOM Exception 18

Any help?

Thanks

Community
  • 1
  • 1
pistacchio
  • 56,889
  • 107
  • 278
  • 420

2 Answers2

5

The document.domain setting only works if your using subdomains, not completely different domains (different ports count as different domains). So you can have server1.mydomain.com and server2.mydomain.com, in which case you set domain to mydomain.com in both the main page and tiny_mce_popup.js. You can't however use mydomain.com and otherdomain.com. For more information on these restrictions see https://developer.mozilla.org/en/DOM/document.domain or http://msdn.microsoft.com/en-us/library/cc196989(VS.85).aspx

I believe there are plans to adjust the way TinyMCE works so that it can have a CDN version which is usable from any domain, but that doesn't currently exist.

Regards,

Adrian Sutton
http://tinymce.ephox.com

ajsutton
  • 538
  • 2
  • 5
  • 1
    how about http and https? for example, base domain is http://domain.com and tinyMCE residing on https://sub.domain.com ? – yaka Jun 01 '11 at 11:02
  • I'd expect that to fail as well. A change from HTTP to HTTPS also changes the port so its got the same problem as the original problem. Even if it was somehow the same port, the protocol change would break it as well - it's *only* subdomains that can be used, no other change at all. – ajsutton Apr 12 '12 at 21:47
0

Are you using Django ? I've answered this question below pertaining specifically to tinymce in django.

Tiny MCE popups blank in Django admin

Community
  • 1
  • 1
Hacking Life
  • 3,335
  • 2
  • 19
  • 20