Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    please, oh please help a poor noob in the middle of a panic! ifx.js

    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.

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,915
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Is this the line you’re talking about?
    Code:
    var cssRules = document.styleSheets[i].cssRules||document.styleSheets[i].rules||null;
    I don’t know what this is supposed to be anyway but it might just be the fact that I’m not the greatest JS guru either. As far as I know a variable can only be one thing (an array being one thing, too). That means you can’t have operators in a variable. So instead of:
    Code:
    var cssRules = document.styleSheets[i].cssRules||document.styleSheets[i].rules||null;
    if (cssRules) {
    …
    you should write
    Code:
    if(document.styleSheets[i].cssRules||document.styleSheets[i].rules||null) {
    …
    However, I have no idea what that “cssRules” variable is. I’d need more info about the script (entire code and/or the page where the problem occurs). But maybe I’m just not proficient enough and somebody else will bring enlightenment.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •