Wymeditor across subdomains. (Cross site permissio

2019-05-04 13:41发布

问题:

I have wymeditor on sub1.domain.com, which is accessed by a page on sub2.domains.com.

This line gives an error:

var styles = this._doc.styleSheets[0];

Permission denied for http://removed.example.com to get property HTMLDocument.styleSheets from http://removed2.example.com.

I am assuming this is a cross site scripting restriction, but I would like to srve my media from a different domain. How can I do this?

回答1:

Add the line document.domain = "domain.com"; in both pages, replacing domain.com with whatever your actual domain name is.