absolute path

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
dy8920
Beginner
Beginner
Posts: 5
Joined: Wed Aug 15, 2007 8:58 pm

absolute path

Post by dy8920 »

I get the menues to work great. However the minute I change the path for the js files from the root of my site up a level I am getting js errors. Here is how I like to read.

Code: Select all

<SCRIPT type="text/javascript" src="../java/milonic_src.js"></SCRIPT> 
<noscript><a href="https://milonic.com/">DHTML Menu JavaScript Menu Powered by Milonic</a></noscript> 
<script type="text/javascript">
 
if(ns4)_d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=../java/mmenuns4.js><\/SCR"+"IPT>"); 
else _d.write("<SCR"+"IPT LANGUAGE=JavaScript SRC=../java/mmenudom.js><\/SCR"+"IPT>"); 

</SCRIPT>
<SCRIPT type="text/javascript" src="../java/menu_data2.js"></SCRIPT>
<SCRIPT type="text/javascript" src="../java/menu_data.js"></SCRIPT>
Do I have to leave it at the root? I would like all my sites to share the menu and if I have to do updates I only have to do them once. Am I missing something?


Thank you[/code]
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,
I would like all my sites to share the menu
I believe the menu must be licensed for each domain/subdomain. I suggest that you contact Milonic directly about that issue since they are the only ones who can decide if a menu needs more than one license or if the use of one menu on subdomains is acceptable. I'm sure as long as there is a license available for each domain, they can set something up so you can use only one set of program files. If I am misunderstanding, please give me some more information on what you mean by all your sites.

Ruth
dy8920
Beginner
Beginner
Posts: 5
Joined: Wed Aug 15, 2007 8:58 pm

Same domain

Post by dy8920 »

Ruth,
Thank you for getting back to me. It is the same domain. I am using it with SharePoint. I have gotten menu_data.js to work but not menu_data2.js. They worked fine when they were located at the root once I moved them out menu_data2.js stopped working. I may try combining them to see if that works. I would like to talk to them direclty but for the live of me I can't find a phone number.

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

Post by John »

You are using site-relative (../) rather than server-relative (/dir/) paths. Almost always a bad idea, one perfect example of which is the problem you've run into.

So, making up an example, using the new call format, and assuming both that you are no longer going to support NS4 (we aren't!) and that /java/ is directly off the root, the calls would look like this...

Code: Select all

<script type="text/javascript" src="/java/milonic_src.js"></script> 
<noscript><a href="https://milonic.com/">JavaScript DHTML Menu Powered by Milonic</a></noscript>
<script type="text/javascript" src="/java/mmenudom.js"></script> 
<script type="text/javascript" src="/java/menu_data.js"></script>
<script type="text/javascript" src="/java/menu_data2.js"></script>
<script type="text/javascript" src="/java/menu_data.js"></script >
Now you can call the code from anywhere with no problems. Even better would be to put the above code into a file by itself and use an include statement to call it.
John
dy8920
Beginner
Beginner
Posts: 5
Joined: Wed Aug 15, 2007 8:58 pm

Post by dy8920 »

John,
Thank you. However that dosen't work either. This code works it just that I want to be able to update the menu once and not have to go into every site folder and change menu_data2.js. I would have to do it hundreds of folders. Idealy I would like to use and absolute path like:

http://ns.cingular.net/sites/npmo/java/menu_data2.js

Code: Select all

<script type="text/javascript" src="../java/milonic_src.js"></script> 
<noscript><a href="https://milonic.com/">JavaScript DHTML Menu Powered by Milonic</a></noscript> 
<script type="text/javascript" src="../java/mmenudom.js"></script>
<SCRIPT type="text/javascript" src="../java/menu_data.js"></SCRIPT>
<SCRIPT type="text/javascript" src="java/menu_data2.js"></SCRIPT>
Thank you for your help
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Well, you've lost me. With the call setup I gave you it would only be necessary to go to /java/menu_data2.js, make whatever changes you need once, and those changes would be automatically included in every menu page.
John
dy8920
Beginner
Beginner
Posts: 5
Joined: Wed Aug 15, 2007 8:58 pm

Post by dy8920 »

That is why I am so confused. Why does it work with menu_data.js and not menu_data2.js? It might have something to do with SharePoint or a license issue. I am going to try combining both menus into menu_data.js and see if that works.

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

Post by Ruth »

Hi,

Do you have link to your page so we can take a look and perhaps then figure out why it's not working? It should work with no problem.

Ruth
dy8920
Beginner
Beginner
Posts: 5
Joined: Wed Aug 15, 2007 8:58 pm

Post by dy8920 »

Thanks
I figured it out I had a syntax error and for some reason it allowed it to work on one site and not the other. I fixed it and it is working great.

Thank you for all your help :D
Post Reply