Forums / Install & configuration / "Error on page" when loading in IE [Solved]

"Error on page" when loading in IE [Solved]

Author Message

Vidar Østevik

Tuesday 25 April 2006 11:18:54 am

Hi everyone!
I've fiddeled around for a bit with eZ publish, and are a very happy user!
But, I have a problem that I cant find any solution for.
Down in the left corner of IE, there are a field telling you if the page is fully loaded.
Every page I load, I get the text "Error on page". When I doule click on the error mark, I'm told that "document.getElementByld(...) is null or not an object" (Direct translated from Norwegian.. May not be exact the phrase in english) in line 3 and 17.
I'm using IE explorer 6.0.2900.2180 SP2.
Nothing is displayed in the error log.

This problem does not show up in Mozilla.

Any suggestions?

Regards,
Vidar

Łukasz Serwatka

Wednesday 26 April 2006 12:09:31 am

Hi Vidar,

Do you use any custom JavaScript scripts in your website?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Vidar Østevik

Wednesday 26 April 2006 8:39:13 am

Hi Lukasz!

I have no custom javascript in my webpage, but I'm running suckerfish as menu.
I guess the error is caused by "script_suckerfish.js", because the java file contains the command "getElementsById".

In line 2 there is

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

And in line 16 there is

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

Maybe this is the problem?I'm not a skilled java programmer, so if anybody have suggestions, I would appreciate it!

I also tried to access the web page via my laptop, running XP Pro and IE 6.0.2900.2180 SP2.
And the error message did not appear here!?

Regards
Vidar

Vidar Østevik

Tuesday 16 May 2006 1:15:34 pm

If anybody have the same problem, the solution that worked for me was to remove the following lines in script_suckerfish.js

sfHover = function() {
          var sfEls = document.getElementById("tache_menu").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);

If you read the double_top.tpl that suckerfish uses as an override, you will find that there are not created any div called tache_menu, so the original script will return the mentioned error ("document.getElementById is null or not an oject") because there does not exist an Element called "tache_menu". So commenting this out would fix the problem!

Vidar