Error on page specific to theme. Please help.

bstrange - February 5, 2008 - 04:21

OK, so I am 100% valid XHTML 1.0 strict, and everything checks out correct for code as far as I can see, but when using my current (and prefered) Beale Street theme, I get the following error on every page of my site http://www.homepcpatrol.com :

Internet Explorer 7.0 error:

Problems with this Web page might prevent it from being displayed properly or functioning properly... blah blah blah info about disabling the message... then the following code:

Line: 3
Char: 2
Error: 'document.getElementById(...)' is null or not an object
Code: 0
URL: http://www.homepcpatrol.com

I am not sure if this error in line 3 is line 3 of the source code as seen by validator i.e.

1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2. <!--$Id: page.tpl.php,v 1.3 2007/09/11 16:45:35 roopletheme Exp $-->
3. <!-- www.roopletheme.com -->
4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5.
6. <head>

Or line 3 of the style.css or what...

The only thing I do know is it is specific to the Beale Street theme as loading the default Garland theme resolves the error.

Any help would be GREATLY appreciated!

Thanks in advance :)

Possible cause

nevets - February 5, 2008 - 04:44

The suckerfish.js (in js directly of theme) has this line

var sfEls = document.getElementById("suckerfishmenu").getElementsByTagName("LI");

but the theme has not element with the id 'suckerfishmenu' so the call to getElementById() returns not an object but I believe null.

So I would file an issue with the theme, it is not clear why it uses the script but does not have the tag. At the least the script should be better prepared to handle errors.

RESOLVED

bstrange - February 5, 2008 - 04:46

Well after playing "random line delete" on the various pages of my site, it occured to me to turn on Microsoft's IE script debugging feature (so I guess it isn't a TOTALLY useless feature :P) and it revealed:

sfHover = function() {
var sfEls = document.getElementById("suckerfishmenu").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

So I went into the theme and unchecked the box for "Use suckerfish menu" and the error is now resolved.

Many thanks to ... me :) for being just barely smart enough to stumble blindly into the answer lol :)

wow talk about late night timing lol

bstrange - February 5, 2008 - 04:49

You posted your reply at the same time I was posting my solution hehe

Thanks for the reply :)

Sorry I missed your reply as I was posting my own... I thought everyone else had gone to bed hehe

one more thing

palik - March 21, 2008 - 20:53

i ran into same error, but i think there is one more solution

1) in admin->menu->settings turn off primary and secondary links
2) in admin->build->blocks move primary menu to 'suckerfish' position
3) enjoy suckerfish menus :)

regards

 
 

Drupal is a registered trademark of Dries Buytaert.