Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

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:30

absolute path


Poster: dy8920
Dated: Wednesday August 15 2007 - 21:10:23 BST

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:
<SCRIPT type="text/javascript" src="../java/milonic_src.js"></SCRIPT>
<noscript><a href="http://www.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]


Poster: Ruth
Dated: Thursday August 16 2007 - 0:39:40 BST

Hi,

Quote:
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

Same domain


Poster: dy8920
Dated: Thursday August 16 2007 - 17:55:02 BST

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


Poster: John
Dated: Thursday August 16 2007 - 20:47:21 BST

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:
<script type="text/javascript" src="/java/milonic_src.js"></script>
<noscript><a href="http://www.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.


Poster: dy8920
Dated: Friday August 17 2007 - 0:30:05 BST

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:
<script type="text/javascript" src="../java/milonic_src.js"></script>
<noscript><a href="http://www.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


Poster: John
Dated: Monday August 20 2007 - 15:54:15 BST

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.


Poster: dy8920
Dated: Monday August 20 2007 - 18:25:13 BST

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 :?


Poster: Ruth
Dated: Tuesday August 21 2007 - 8:47:11 BST

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


Poster: dy8920
Dated: Tuesday August 21 2007 - 17:50:57 BST

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