"_d" is undefined

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
BigJohnson
Advanced
Advanced
Posts: 14
Joined: Sat May 01, 2004 7:55 pm

"_d" is undefined

Post by BigJohnson »

Hi all

Been using the menu with great success on a website, but now I've come to setup a new website and use the menu, and I get an error "_d is undefined".

As far as I can tell, the setup is exactly the same so it should work. I've also downloaded and tested a new sample menu and this too fails. I understand that this may mean that it is a site issue, but I'm not too sure as to where this may originate from.

<SCRIPT language=JavaScript src="/_menu1/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript> _d.write("<scr"+"ipt language=JavaScript src=/_menu1/mmenudom.js><\/scr"+"ipt>"); </script>
<SCRIPT language=JavaScript src="/_menu1/menu_data.js" type=text/javascript></SCRIPT>

Can anyone help?
perldev
Mega User
Mega User
Posts: 115
Joined: Thu Aug 26, 2004 5:23 pm
Location: Chicago

Post by perldev »

most likely milonic_src.js wasn't executed; can you directly download the file from http://yoursitedomain/_menu1/milonic_src.js?
slackbladder
Super Advanced
Super Advanced
Posts: 72
Joined: Fri Jul 01, 2005 3:04 pm

Post by slackbladder »

Code: Select all

<SCRIPT language=JavaScript src="/_menu1/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/_menu1/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/_menu1/mmenudom.js><\/scr"+"ipt>"); </script>
<SCRIPT language=JavaScript src="/_menu1/menu_data.js" type=text/javascript></SCRIPT>
BigJohnson
Advanced
Advanced
Posts: 14
Joined: Sat May 01, 2004 7:55 pm

Post by BigJohnson »

I tried the quoted code, which is the same as my previous site. However it too errors "_ns4 is undefined".

Also, yes - I can down load the .js file, which makes it more of a quandry!

There's something about this site which the menu doesn't like and I can't locate it. :x
slackbladder
Super Advanced
Super Advanced
Posts: 72
Joined: Fri Jul 01, 2005 3:04 pm

Post by slackbladder »

To have a better chance at helping we need a url to look for ourselves.
slackbladder
Super Advanced
Super Advanced
Posts: 72
Joined: Fri Jul 01, 2005 3:04 pm

Post by slackbladder »

Also review Kevins reply in this post:

viewtopic.php?t=5323
BigJohnson
Advanced
Advanced
Posts: 14
Joined: Sat May 01, 2004 7:55 pm

Post by BigJohnson »

It seems that if I call the menu from the menu folder it works. If I call the menu from anything folder "../menu/..." then it fails. Very strange this as it worked and still does work using the latter on a current website.

Any ideas?
slackbladder
Super Advanced
Super Advanced
Posts: 72
Joined: Fri Jul 01, 2005 3:04 pm

Post by slackbladder »

To have a better chance at helping we need a url to look for ourselves.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

As Slack noted a url would help a lot more. So, take this with a grain of salt.

I remember reading someplace in a post something about the _ in file names and the menu not liking it in some instances. I noticed you had the _menu as the folder name. Not sure if that has anything to do with it, and I can't remember the full context of the post about the _ and can't find it now :(

Just thought I'd mention it, though it may be totally out in left field [and it may have been a particular release which got fixed later]

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Big J,

_d is shorthand for the javascript document object. In js coding, it is common to define such abbreviations for objects that you plan to use a lot, so that it cuts down on the amount of code and the resulting file size (e.g., typing _d several hundred times instead of document).

In the milonic system, _d is defined in milonic_src.js. So, the likely explanations for _d being undefined are: (1) milonic_src.js is not loading, as suggested by others in this thread, or (2) milonic_src.js is loading, but the file is incomplete or otherwise corrupted. To help you figure out which, we would need a URL to a test page.

Cheers,

Kevin
Post Reply