Yet another PATH problem

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
enacheandrei
Beginner
Beginner
Posts: 4
Joined: Mon Oct 23, 2006 4:54 am

Yet another PATH problem

Post by enacheandrei »

Heya.There is an archive at www3.infoiasi.ro/~enache.andrei which contains an early stage of a site I inted to create.Now the problem is that on my machine I can use the absolute paths and everything goes nicely...but I have no ideea where the web master will place my page,so absolute paths just won't do.Can I do something like:

Angry Developer:Hey!You!
Little Green Menu:Who me?
Angry Developer:Yes you!Do you know where menu_data.js is?
Little Green Menu:Yes.
Angry Developer:Well al the links that I give you are relative to where the menu_data.js is!!!

Can't i get the menu to know where it's sources are and seek the files in the "URL" attribute relative the location of the sources rather that to the current directory?

The directory structure is something like this:
E:/Some dirs here/WebPage/ <!** Menu files and index.htm is here**>
E:/Some dirs here/WebPage/Legislatie <!** Some content here**>
E:/Some dirs here/WebPage/Statistici <!** Some content here**>

Note that I don not know what "Some dirs here" are.The web master will decie where he will place it and I have to make it so that he can relocate it wich out me having to rewrite the URS's in menu_data.js.

Now for the problem.I use just relative paths.
Current dir = WebPage;
User click's on a link which openes a page in Legislatie;
Current dir = WebPage/Legislatie;
User click's on a link which (should) open a page in Statistici;
Error -- Unknown URL --- Error Because the menu is using the Current dir to work out what page I need (because I use just relative paths) instead of using the dir in which I have placed the "*.js" needed to have the menu working.
There for my question.Can I make the dir calculate paths from the dir I have placed the sources or I am stuck with using absolute paths(which I may not know).
Thx for taking the time to read sucha long post :P Have a nice day now
Btw...sry for any writing mistakes :)
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Code your menu using server relative addressing/paths. The Search function here will return numerous posts on this subject.
John
enacheandrei
Beginner
Beginner
Posts: 4
Joined: Mon Oct 23, 2006 4:54 am

Post by enacheandrei »

OK,thx...I'll see what I can find.
enacheandrei
Beginner
Beginner
Posts: 4
Joined: Mon Oct 23, 2006 4:54 am

Post by enacheandrei »

Found it.
Angry developer -> Happy developer :)
Cheers!
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Now - wasn't that easy...? :roll:

Glad you got it.
John
enacheandrei
Beginner
Beginner
Posts: 4
Joined: Mon Oct 23, 2006 4:54 am

Post by enacheandrei »

:P
Post Reply