Relative vs Full URL

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
perlmonger
Beginner
Beginner
Posts: 3
Joined: Mon May 03, 2004 8:23 am
Location: Ontario, Canada
Contact:

Relative vs Full URL

Post by perlmonger »

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
User avatar
bobwill
Mega Advanced
Mega Advanced
Posts: 229
Joined: Tue Oct 01, 2002 3:03 pm
Location: Kansas
Contact:

Post by bobwill »

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"
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Jim,

Just a thought, you are using a secure server, do you have the blank file in the same folder with your menus?

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

Re: Relative vs Full URL

Post by John »

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?
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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
perlmonger
Beginner
Beginner
Posts: 3
Joined: Mon May 03, 2004 8:23 am
Location: Ontario, Canada
Contact:

Post by perlmonger »

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
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
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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. :)
John
perlmonger
Beginner
Beginner
Posts: 3
Joined: Mon May 03, 2004 8:23 am
Location: Ontario, Canada
Contact:

I'll upgrade

Post by perlmonger »

Thank you. I'll upgrade the version and take it from there.

Best Wishes,
Jim Melanson
Post Reply