Cut and pasting vertical menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
tubize
Advanced
Advanced
Posts: 27
Joined: Tue Sep 30, 2003 9:14 am

Cut and pasting vertical menu

Post by tubize »

I have a weird situation and it has been cleared up in the past through trial and error but I think it is time I find out what is happening.

I have a vertical menu working in a directory of my site and want to set up another file in a different directory that uses a similar vertical nav. If I set up the include in the second file to bring in the old vertical menu from the first file, it works perfectly.

For example, I am in busdirectory/newadmin/index.cfm and I bring in the menu with this code:
<SCRIPT src="/club/awcb/navigation/nav_admin.cfm" language="javascript"></SCRIPT>
The menu comes up perfectly but when I copy the exact menu file from the first directory to the second directory and try to bring the menu in with this code:
<SCRIPT src="/busdirectory/newadmin/nav_admin.cfm" language="javascript"></SCRIPT>, I get an error message every time and the menu does not display. I don't get anything from the error message because it mentions a line that is higher than the lines I have in either file.
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Is nav_admin.cfm your menu data file? If so, I'd use a <cfinclude> rather than the <script>. I think it's actually not a script to CF because of your .cfm suffix on the file.

I have mine set up like this...

Nav_Standard.cfm...

Code: Select all

<script language="JavaScript" src="/sai/templates/menu5/milonic_src.js" type="text/javascript"></script>	
<script language="JavaScript" type="text/javascript">
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/sai/templates/menu5/mmenuns4.js><\/scr"+"ipt>");		
else _d.write("<scr"+"ipt language=JavaScript src=/sai/templates/menu5/mmenudom.js><\/scr"+"ipt>");</script>
<script language="JavaScript" src="/sai/templates/menu5/xp_data.cfm" type="text/javascript"></script>
That is called from inside the <head> with a <cfinclude> where needed.
John
tubize
Advanced
Advanced
Posts: 27
Joined: Tue Sep 30, 2003 9:14 am

Why would that matter?

Post by tubize »

John,
Thanks for your prompt reply. I haven't tried your suggestion but do not know why it would make a difference because the javascript include works throughout the site in calling up my cfm milonic menu.

In this case, the only thing different is the directory that I am calling the file from. It calls it from one directory okay but not from the other directory;
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

I see you're using server-relative addressing (which is great). No offense, but I must ask - is the failing path correct? I've managed some pretty good boners on my sites by starting the path in the wrong place (dropping a directory, etc.).
John
Post Reply