Help - Search - Members - Calendar
Full Version: Java Script error 'elsedocument'
xFX JumpStart Public Forums > DHTML Menu Builder > Generic Problems > JavaScript Errors
ghodges
Anyone please help.

I just rebuilt my menu on my site and now get the following error in IE7 & IE6 on 2 different computers, so its not on my PC.

The error is on all the pages that I installed the menu on.

Error:

Java Script Error

Description:'elsedocument' is undefined
Source:http://www.bluegrassit.com/index.html
Line:6

Nothing on Line 6 gives a clue, as that line is just CSS code

But on one line I have the 2 words, not together, "else" or "document" as follows:

Line 87: var rimPath=null;var rjsPath=null;var rPath2Root=null;function InitRelCode(){var iImg;var jImg;var tObj;if(!document.layers){iImg=document.images['dmbif'];jImg=document.images['dmbjs'];tObj=jImg;}else{tObj=document.layers['dmbri'];if(tObj){iImg=tObj.document.images['dmbif'];jImg=tObj.document.images['dmbjs'];}}if(!tObj){window.setTimeout("InitRelCode()",700);return false;}rimPath=_gp(iImg.src);rjsPath=_gp(jImg.src);rPath2Root=rjsPath+"../";return true;}function _purl(u){return xrep(xrep(u,"%%REP%%",rPath2Root),"\\","/");}function _fip(img){if(img.src.indexOf("%%REL%%")!=-1) img.src=rimPath+img.src.split("%%REL%%")[1];return img.src;}function _gp(p){return p.substr(0,p.lastIndexOf("/")+1);}function xrep(s,f,n){if(s) s=s.split(f).join(n);return s;}InitRelCode();


Then on the following lines I had the two words appear, but again, not on the same line.

Line 93: document.write('<' + 'script language="JavaScript" type="text/javascript" src="' + rjsPath + 'nsmenu.js"><\/script\>');

Line 94: } else {

Line 95:document.write('<' + 'script language="JavaScript" type="text/javascript" src="' + rjsPath + 'iemenu.js"><\/script\>');

For the life of me I can't see where the problem might be? All the images that support DMB file are in the right places, the menu operates fine, after acknowledging the error. Its a very simple menu, no sub-commands, as of yet. I don't see any leftover code from the previous menu I had...so I really have no clue...

Please help...

thanks,

Gary
Hywel
Could you post a URL to this in action, please? JavaScript errors can be difficult to debug as the line numbers given by IE are not always helpful.
Hywel
Ah, you've changed the file name.

The error is not in DMB code, it's in this file:
http://www.bluegrassit.com/_j-moves/general.js

Search for "elsedocument" to find the error. There are four or five instances of this. Unfortunately the code in that file is poorly formatted, so it might be tricky to sort out.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.