ns4 undefined

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
nomis5
Beginner
Beginner
Posts: 2
Joined: Wed May 30, 2007 1:45 pm

ns4 undefined

Post by nomis5 »

Hi,
I've downloaded the menu, put it on a simple page but it fails with the message 'ns4' undefined. Any ideas why? Thanks in advance

nomis5
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

It sounds like you are calling the mmenuns4.js module but have not put the module where it can find it, but without the page this is only a guess.

If you have to support ns4 your calls would be [I'm assuming root directory for the menu files]

Code: Select all

<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");		
  else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>"); 
</script>
<script type="text/javascript" src="menu_data.js"></script>
This means you would have to have all four of those files at whatever your path is for your files.

If you do not need to support NS4, then your calls would just be

Code: Select all

<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript" src="mmenudom.js"></script>
<script type="text/javascript" src="menu_data.js"></script>
and you would only need to upload these 3 files.

Ruth
nomis5
Beginner
Beginner
Posts: 2
Joined: Wed May 30, 2007 1:45 pm

Post by nomis5 »

Hi Ruth,

I've pasted the three lines into the page as you suggested, ignoring Netscape support for the moment. It no longer errors but no menu appears. The page is http://www.cookuk.co.uk/apple_pie_recip ... -menu1.htm

The three js files are in the same place as my index page (httdocs which I think is root), but that is probably correct because I am not getting any error message saying the js files could not be found.Any more ideas.

Dave
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

You file paths are incorrect. The error from before was probably a result of this. When you just put in the file name, then it expects to be the same place as the page on which you have the calls. So, if that httdocs or whatever is the root for your cookuk then you need to set your path for the files as

Code: Select all

http://www.cookuk.co.uk/milonic_src.js
and so on for all files.

Ruth
Post Reply