Hi,
i have a little problem and i have no idea what is wrong
var selector_css;
var sheet= document.styleSheets[0];
var rules= 'cssRules' in sheet? sheet.cssRules : sheet.rules;
for (var i= 0; i<rules.length; i++)
{
var rule= rules[i];
var text= 'cssText' in rule? rule.cssText : rule.selectorText+' {'+rule.style.cssText+'}';
text = text.replace(/\s/g, '');
selector_css = text.match(/^(.*?){/gi);
// selector_css = selector_css.replace(/{/g,''); // <- dont work ?
$('body').append('- '+selector_css+' <br />');
}
Everything works fine but when i add
selector_css = selector_css.replace(/{/g,'');
I dont get a result or an error, but why? Can somebody help me?
Thanks in advance!
Peter