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: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Wednesday July 18 2012 - 06:07:20

problem with path


Poster: johnnybear
Dated: Saturday October 26 2002 - 9:58:22 BST

:roll: Have a small problem regarding path to a folder containg required files.
I have my menus operating across frames and all works beautifully. However, when I move a HTM document (called "one.htm") to a folder called "test_folder", I have the path to it set like this
addmenu(menu=["welcome",
,,100,1,"",plain_style,,"center",effect,,,,,,,,,,,,
,"Introduction", "intro.htm",,,1
,"Background", "test_folder/one.htm",,,1
,"Methodology", "doc_one.htm#methodology",,,1 , I want to refernece
,"Role of Officers", "show-menu=role_of_officers",,,1
,"Security","show-menu=secure",,,1
,"Legend","#",,,1
,"Logging On","#",,,1
,"Enquiries","show-menu=enquiries",,,1

])

I keep getting the standard browser (MIE 6) window: "This Page Cannot Be Displayed".
Nothing has changed except the location. What am I missing here? I have followed the usual syntax but for some reason I keep getting the above mentioned error message ! !
Help Please !
And thanks in advance.


Poster: Andy
Dated: Sunday October 27 2002 - 9:18:37 GMT

Try putting the full path in like this

Code:
"Background", "http://www.domain.com/test_folder/one.htm",,,1


Once you get this to work you can then remove the http://www.domain.com but make sure that you leave in the / before the test_folder/one.htm part, this will tell the browser to always start at the root of your server.

-- Andy

yes, but!


Poster: johnnybear
Dated: Sunday October 27 2002 - 9:35:05 GMT

Thanks for that. :)
But what about testing purposes? I'm creating this for an Intranet site but need to test on my own computer at home where I do most of my work, so all files are on my hard-drive at the moment. Why won't the usual syntax work or is a full path a requirement of the script? Is there a way around this ? :roll:
Appreciate your help :P


Poster: Andy
Dated: Sunday October 27 2002 - 9:54:36 GMT

There are 2 ways around this, a quick but not the best way and a proper, future proof way.

The quick way is to add a global variable that you can change depending on where you are. Here's how:

In your menu_array.js (at the top) add this line.

Code:
var domain="http://www.yourdomain.com/"


then add the variable "domain" to each of your menu items like this:

Code:
"Background", domain+"test_folder/one.htm",,,1


When you get home you just need to change the domain variable to whatever your directory is. an example might be:

Code:
var domain="file:///c:/homewebs/"


Now, that's the yucky way, it works but it's not the best solution. The best way is to completely replicate what you have at work on your web server. The only real way to do this is to actually install a web server on your home computer. If you are running Windows 2000 or XP you might already have a web server installed. Try http://127.0.0.1/ in your web browser at home and see if anything comes up. If it does you just need to find the directory where you need to install your HTML files and your webserver will work.

If you only have Windows 98 or Windows ME you can still install a web server in the form of PWS (Personal Web Server) that comes with FrontPage, I believe you can download it from Microsoft's site too but not sure where from though.

In either way it's a simple install and you just copy your HTML files to the correct location and you have a fully functioning web server.

So, basically the problem you are having is down to directory structures between machines.

Web Servers always use Unix style paths like this /menu/forum/ but Windows uses it's own style c:\menu\forum so what you need to do is match them up and the best way is to install a web server

Hope this helps
Andy

pain!


Poster: johnnybear
Dated: Sunday October 27 2002 - 13:41:00 GMT

Thanks Andy,
I'll just dump everything into one folder. Problem solved ! Perhaps this feature cum expectation could be incorporated into future releases?