Here is the code:
You\'ll notice the alert(document.styl
The stylesheet is there and works fine, you just cannot access the cssRules property of the stylesheet because it is set to null by the browser.
The security error you get is due to the same origin policy - you are working on stylesheets from another domain, you will not have this problem if the stylesheets are hosted on the same domain your webpage is.