Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-03-18 10:12:46

alan
New member
Registered: 2005-03-18
Posts: 3

Problem with Same Origin Policy across subdomains

Suppose I want to generate a page in PHP  that contains a xinha editor.  Easy enough.  Now suppose i have a site that for performance reasons requires static content to be served from a separate server to the PHP content (the "static" server wont be running PHP, and the PHP server shouldn't serve any images/javascript or we'll loose the performance edge that we gained by splitting the content up.)  It still seems relatively easy at this point just to shift xinha's folder over to the static content server, and point to it from the generated php page.  So far so good.  Except that when using anything in the editor that requires a popup window, it wont be able to access the original editor because of the Same Origin Policy within javascript.

Now, Mozilla.org very kindly tells us how to get around this if the 2 servers are subdomains of the same domain name - you insert the line document.domain = "mydomain.com", and thus allow script from www1.mydomain.com and www2.mydomain.com to access each others properties.

Problem is, with that line added in my page (the generated php page), the editor never finishes loading.  I've tried relocating the document.domain line to just about every one of the JS files (and all at the same time), and various locations on the calling page, all to no avail.

Has anyone else had this problem, or better still - a solution?

thanks

a

Offline

#2 2005-03-18 11:57:09

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: Problem with Same Origin Policy across subdomains

perhaps you must set it for the iframe-document?


Niko

Offline

#3 2005-03-18 13:24:30

alan
New member
Registered: 2005-03-18
Posts: 3

Re: Problem with Same Origin Policy across subdomains

Thanks for the speedy response.  Love the idea - something i missed completely.  Will give it a whirl and report back.

Offline

#4 2005-03-19 01:45:25

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Problem with Same Origin Policy across subdomains

Seems like a fairly unusual situation.  If you find a solution please submit a ticket (with patch if necessary) so that others may learn from your experience smile


James Sleeman

Offline

#5 2005-03-19 10:21:34

alan
New member
Registered: 2005-03-18
Posts: 3

Re: Problem with Same Origin Policy across subdomains

Would be glad to once I've got it cleared up - At the moment I seem to be getting closer acting on niko's suggestion of setting the document.domain for the iframe.  Problem is, that's now throwing a "Permission Denied to set property HTMLdocument.domain".  Am still largely confident it must be possible somehow though ...

Offline

Board footer

Powered by FluxBB