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