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
Relative vs Full URL
Poster: perlmonger
Dated: Monday May 3 2004 - 8:32:01 BST
In the main call for the files, the relative URL works fine:
<script language=JavaScript src="milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="cdn_menu_data.js" type=text/javascript></script>
However, the full URL does not work at all:
<script language=JavaScript src="https://www.effectuality.com/store/milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="https://www.effectuality.com/store/cdn_menu_data.js" type=text/javascript></script>
You can see the menu working with the relative URL:
http://www.effectuality.com/store/item. ... ng=english
Add any quantity of the item (cart under development, is not live yet) and you will see on the resulting page that the menu will not show at all (here it has a full URL).
Does anyone have any idea why this is happening and more importantly, how to overcome it? I can not have the *.js files in the cgi-bin as they are dynamically generated from a database.
Thanks and best wishes,
Jim
Poster: bobwill
Dated: Monday May 3 2004 - 13:23:13 BST
I would suggest that you do the following, since http://www.effectuality.com/store/ is your root directory. Place the menu files in your root directory or a sub directory off of root.
<SCRIPT language=JavaScript src="/store/milonic_src.js"
<SCRIPT language=JavaScript src="/store/menu/milonic_src.js"
Poster: Maz
Dated: Monday May 3 2004 - 17:54:09 BST
Jim,
Just a thought, you are using a secure server, do you have the blank file in the same folder with your menus?
maz
Re: Relative vs Full URL
Poster: John
Dated: Monday May 3 2004 - 18:11:54 BST
perlmonger wrote:
Does anyone have any idea why this is happening and more importantly, how to overcome it? I can not have the *.js files in the cgi-bin as they are dynamically generated from a database.
I don't see anything here that says your JS files have to be in the cgi-bin. They can be anywhere. Also, the only file(s) generated by the DB are the _data files, not the code files (of course).
In your case you might need two sets of menu code files IF you are using the menu in both secure and unsecure modes. The reason for this is you should not be calling the JS from a secure location if they are located in an unsecure location. That 'should' produce an error, or at the very least a warning message.
I say 'should' because I just went through the very same thing, calling the menu files, located in an http area, from an https area. In my case it worked, but according to the boss it shouldn't. He's the expert, so I put another set of everything menu related in the https area. Works.
So - menu in both locations, or just one?
Poster: kevin3442
Dated: Monday May 3 2004 - 22:54:38 BST
Hi Jim,
When you didn't mention mmenudom.js and mmenuns4.js in your example I became suspicious and checked. Sure enough, you are using version 5, Release Candidate 6. RC6 is way, way, way old... it's a very early version of the beta release. If you spend time getting things to work right with RC6, then eventually update, you'll have to spend more time getting it to work again. Might as well spend that time getting it to work with the current release... download the latest update, then upload milonic_src.js, mmenuns4.js, and mmenudom.js over your old ones. Read the .txt files that come in the download archive... there are some procedural changes since RC6 (e.g., no more scriptpath variable to set, and a few syntax changes in menu_data.js).
Come back here if you have questions during the process.
Cheers,
Kevin
Poster: perlmonger
Dated: Tuesday May 4 2004 - 14:23:42 BST
Maz wrote:
Jim,
Just a thought, you are using a secure server, do you have the blank file in the same folder with your menus?
maz
Just a thought, you are using a secure server, do you have the blank file in the same folder with your menus?
maz
Not sure what you mean by a blank file. The four files are in the /store folder as well as in the top level folder for top level HTML docs to use. The menu_data.js is rebuilt dynamically using custom code and not a milonic built function as I have to build two sets, one for American store and one for Canadian store.
It seems only to work when the *.js files are in the same folder as the calling HTML file. I've tried full URL and relative URL's (/store/menu_data.js) and it doesn't work that way. It does with other *.js files but not these ones and that is why I think I'm just missing something simple. I do have the scriptpath set in the milonic_source.js file. It all works fine if the HTML file/PHP file is in the same folder as the *.js files, just doesn't work when it's not in the same one.
Can I put the *.js files in the cgi-bin, same folder as the Perl script?
There is no separate secure area on the server. The secure URL points to the same data folders as the non-secure URL. (https://effectuality.com/index.html looks at the exact same file as http://effectuality.com/index.html)
Thank you to everyone for your help!!!!
Jim
Poster: John
Dated: Tuesday May 4 2004 - 15:00:13 BST
Jim -
You still need to upgrade your menu code, as mentioned by Kevin. We simply cannot support something this old (officially, as posted, we support only the current release). Current is 5.15, which literally puts you 60-70 versions down!
Follow Kevin's instructions, and let us know if you need help during the process. No more RC6.
I'll upgrade
Poster: perlmonger
Dated: Wednesday May 5 2004 - 15:10:25 BST
Thank you. I'll upgrade the version and take it from there.
Best Wishes,
Jim Melanson