PDA

View Full Version : explode.js



chloedearest
08-10-2006, 03:08 PM
I have been asked to help update a web site for my local church. Thier site uses the explode.js as the menu on the left side of the page. when the menu is clicked I get an error stating that an object is expected. It seems like the error is in the line:

<body onload="gogirl('Couples_Ministry');init();">

I can do the (x)html and css necessary to bring the site up to standards but I am not profecient in javascript
Can any one help with this one??

thanks

Chloe

site is www.udlc.org

mburt
08-10-2006, 03:25 PM
Either the function gogirl() isn't valid, or the object "Couples_Ministry" isn't valid. Either way, I need to see the script :)

blm126
08-10-2006, 03:41 PM
you haven't defined init(). You should either remove it.


<body onload="gogirl('Couples_Ministry')">

or define it in explode.js


function init(){
//Do something
}

chloedearest
08-10-2006, 04:39 PM
it looks to me like the function gogirl is defined.
the error happens whenever you use the left nav panel
it can be at the either in the major categories or the sub categories in the menu.

javascript is:



function gogirl(e) {
hideall();
if (document.getElementById(e).style.display == 'none') {
document.getElementById(e).style.display = 'block';
} else {
document.getElementById(e).style.display = 'none';
}
}

function hideall() {
//var Nodes = document.getElementsByTagName('ul');
var Nodes = document.getElementById('exploderMenu').getElementsByTagName('ul');
var max = Nodes.length;
for(var i = 0;i < max;i++) {
var nodeObj = Nodes.item(i);
nodeObj.style.display = 'none';
}
}

Twey
08-10-2006, 04:52 PM
it looks to me like the function gogirl is defined.gogirl() is. init() isn't.

chloedearest
08-10-2006, 04:55 PM
can i safely remove init() or do i need to do something more??

Twey
08-10-2006, 06:02 PM
Since the script seems to work OK, I'd say to remove the call to init().

chloedearest
08-10-2006, 06:21 PM
Thanks I will try it tonight!!