I get this error in FireBug when I try to access some CSS files hosted on external domains:
Security error" code: "1000
rules = styleSheets[i].cssRules;
The code I am using is:
$(document).ready(function () {
$("p").live('mousedown', function getCSSRules(element) {
element = $(this);
var styleSheets = document.styleSheets;
var matchedRules = [],
rules, rule;
for (var i = 0; i < styleSheets.length; i++) {
rules = styleSheets[i].cssRules;
for (var j = 0; j < rules.length; j++) {
rule = rules[j];
if (element.is(rule.selectorText)) {
matchedRules.push(rule.selectorText);
}
}
}
alert(matchedRules);
});
});
Is there a way to fix this, beside moving all the css files on the same domain? Thank you