The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Codepen cross-domain external CSS

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #191983

    Hi there,

    A happy new year first of all!

    While testing the script I wrote to insert new rules into the stylesheet with JavaScript, I noticed the cssRules return null with Firefox and Chrome when using an external link to the sheet. IE seems to be functioning normally.

    I figured out this has to do with same-domain policy but can’t quite figure out (or find online exactly) how to proceed with this. I would actually like to test it further on Codepen.

    Should I allow cross-domain file access for the folder where the CSS file is located? And might there be any caveats to this?
    Since the pen/folder would be open to anyone, I feel that might not be such a wise thing to do. But I am not entirely aware of how this functions. So any tips or advice are much appreciated.

    Thanks in advance.

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.