JavaScript Error

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
GateOperators
Beginner
Beginner
Posts: 2
Joined: Wed Oct 15, 2003 11:06 pm

JavaScript Error

Post by GateOperators »

I am taking a template page I created, with menus that are opperational and copying this page onto a new page to create additional pages within my site. Even though the page is a direct copy and within the same directory of the one that is working, I still get the following errors:

An error has occured in the script on this page

Line: 12
Char: 2
Error: 'nsr' is undefined
Code: 0

An error has occured in the script on this page

Line: 36
Char: 1
Error: 'menuname is undefined'
Code: 0

Do you have any thoughts on why this is occuring?

Thanks in advance...
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Do you have the menu JS calls on the new page(s) in addition to the data?

Post a URL.
John
GateOperators
Beginner
Beginner
Posts: 2
Joined: Wed Oct 15, 2003 11:06 pm

Post by GateOperators »

I belive I do.

Here is the page with the working menu:

http://www.proaccesssouthwest.com/index2.htm

Here is the page with the menu not working:

http://www.proaccesssouthwest.com/Produ ... e_Main.htm
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Well, you forgot a bit.

You have...

Code: Select all

<SCRIPT language=JavaScript src="../../../milonic_src.js" type=text/javascript></SCRIPT>	
<script language=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>
<SCRIPT language=JavaScript src="../../../menu_data.js" type=text/javascript></SCRIPT>
You've got those oh-so-deep references for _src.js and _data.js, but not for mmenuns4.js and mmenudom.js.

It's really not a good idea to code that way. Using server relative code will keep you from having to change those calls for every different page level you have. Plus, you could then use a single include file and statement to cover the whole site.
John
Post Reply