tags:

views:

51

answers:

1

Hi,

so, guys, I know I am way over my head, so have pity. I'm trying to learn.

This is in file called ifx.js

I had programmers work on my project, and it's been fine, until recently on Firefox, where it just.... isnt.

The Error received when I try to perform the action (opening a horizontal menu) is:

Error: [Exception... "Security error" code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)" location: "http://xxx.xxx.xx.xxx/~yvonechr/users/lib/ifx.js Line: 389"]

The area in the file is here: (line ending in NULL is line 389 [CODE]

for (p in prop) {
    if (p == 'style') {
        var newStyles = jQuery.parseStyle(prop[p]);
        for (np in newStyles) {
            this.getValues(np, newStyles[np]);
        }
    } else if (p == 'className') {
        if (document.styleSheets) for (var i = 0; i < document.styleSheets.length; i++) {
            var cssRules = document.styleSheets[i].cssRules || document.styleSheets[i].rules || null;
            if (cssRules) {
                for (var j = 0; j < cssRules.length; j++) {
                    if (cssRules[j].selectorText == '.' + prop[p]) {
                        var rule = new RegExp('\.' + prop[p] + ' {');
                        var styles = cssRules[j].style.cssText;
                        var newStyles = jQuery.parseStyle(styles.replace(rule, '').replace(/}/g, ''));
                        for (np in newStyles) {
                            this.getValues(np, newStyles[np]);
                        }
                    }
                }
            }
        }
    } else {
        this.getValues(p, prop[p]);

I'm sorry if this post is just so wrong, but I'll learn, really. And if anyone can help me, I'll be so thankful, you won't believe it.

+1  A: 

The problem is probably because your css file is hosted in another domain and you're trying to access cssRules.

If it is possible you should host your css file in the same domain and it will work.

I found this blog post describing the same issue.

Soufiane Hassou
thank you, thank you! I'm looking into this
Elliott Hund