...

View Full Version : jQuery please, oh please help a poor noob in the middle of a panic! ifx.js



Elliott Hund
06-20-2010, 01:52 AM
Hi,

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

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.
:o:(

VIPStephan
06-21-2010, 02:22 AM
Is this the line you’re talking about?

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:

var cssRules = document.styleSheets[i].cssRules||document.styleSheets[i].rules||null;
if (cssRules) {


you should write

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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum