Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:01
ns4 is undefined Error
Poster: Cin Coder
Dated: Wednesday December 22 2004 - 16:33:13 GMT
When I plugin the new menus, the page loads without the menu and the following error is thrown:
ns4 is undefined
Any help with this would be appreciated. This is an intranet page, so I cannot post a link....
Here's a sample of the calls to the menus....
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../../ __at__ all/documents/general/style.css">
<meta name="keywords" content="marketing contacts, contacts">
<meta name="description" content="">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- JS includes to create the navigational drop downs -->
<script type="text/javascript" src="milonic_src.js"></script>
<script type="text/javascript">
<!--
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
-->
</script>
<!-- Start header table with logo and global nav -->
<table width="772" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" width="164"><img src="../../../ __at__ images/documents/general/hdr_logo.gif" width="164" height="65"></td>
<td width="304"><img src="../../../ __at__ images/documents/general/hdr_curve.jpg" width="304" height="19"></td>
<td width="304" bgcolor="#17437A"><p><img src="../../../ __at__ images/documents/general/nav_dot.gif" width="11" height="10"><a href="../../../ __at__ all/documents/general/Default.asp" class="topNav"></a> <img src="../../../ __at__ images/documents/general/nav_dot.gif" width="11" height="10"><a href="" class="topNav">Feedback</a> <img src="../../../ __at__ images/documents/general/nav_dot.gif" width="11" height="10"><a href="" class="topNav">Contact Us</a></td>
</tr>
<tr>
<td width="304"><img src="../../../ __at__ images/documents/general/hdr_welcome.jpg" width="304" height="46"></td>
<td width="304"><img src="../../../ __at__ images/documents/general/hdr_img.jpg" width="304" height="46"></td>
</tr>
<!-- Empty row to allow space for js generated DHTML menu -->
<tr>
<td width="164"><script type="text/javascript" src="menu_data.js"></script>
</td>
<td width="304"><img src="../../../ __at__ images/documents/general/spacer.gif" width="1" height="20"></td>
<td width="304"><img src="../../../ __at__ images/documents/general/spacer.gif" width="1" height="20"></td>
</tr>
</table>
Poster: John
Dated: Wednesday December 22 2004 - 18:09:22 GMT
Exactly what menu version are you running?
Just to check, are you sure all menu files are in place, and uploaded as text (ASCII)?
When posting code, please use the code tags.
ns4 undefined error
Poster: Cin Coder
Dated: Wednesday December 22 2004 - 18:17:41 GMT
I am using the latest version from today and I'm sure that all the files are in place.
I ran our existing file thru the converter.....
What am I missing?
Re: ns4 undefined error
Poster: kevin3442
Dated: Wednesday December 22 2004 - 18:48:07 GMT
Cin Coder wrote:
...I ran our existing file thru the converter.....
What file, through what converter? v3 menu_array.js?
Cin Coder wrote:
ns4 is undefined
Was it that exactly? Or was it "ns4 is not defined"? This would be typical of the error message you'd see in NS7 if it did not successfully load the file, milonic_src.js.
I tried your sample html code along with with the menu_data.js from the basic horizontal menu sample and everything loaded fine. All I can conclude from that is that there's nothing generally wrong with the .html sample code you provided.
Within the menu system, ns4 is defined in milonic_src.js. Assuming that the error occurs when the browser hits the if(ns4) test when loading the menu .js files, you'd get the "ns4 is not defined" error if milonic_src.js did not load properly for some reason. Why would it not load? Several possibilities. (1) You do not have milonic_src.js on your server. (2) You do have it on your server, but in a path other than the one you are trying to load it from your html code. (3) You have it on your server, but it's corrupted.
Try downloading 5.64 again, then upload the new menu source files. Make sure you upload all three source files to your server: milonic_src.js, mmenudom.js, and mmenuns4.js. Make sure that your html code uses the appropriate path when loading the .js files (I notice in your sample code that you have a lot of ../../../ stuff going on. Might not be the best approach to paths).
Hope that helps,
Kevin