Quote:
Originally Posted by johnsmith153
I need to be able to read the contents of the CSS file in JS like in the example. Obviously I can use the styles, but that's not what this is about.
Is there no way to do this?
|
As devnull69 has said, you are blocked by the Same Origin Policy.
JavaScript automatically prevents scripts on one server from accessing properties of documents on a different server. This restriction prevents scripts from, for example, fetching private information such as directory structures or user session history
Simply stated, the SOP states that JavaScript code running on a web page may not interact with any resource not originating from the same web site.
Don't ask for a work-around - there isn't one.