PDA

View Full Version : directing dependent files to folder



beinbeisser
05-09-2005, 03:50 PM
I work with topmenu navigation 3 script and included it into my site (the template file)
one problem: I want all files (menu.js, custom.js., sniffer js. etc.) to stay in the menu folder (=topmenu3 folder)
except the one file I included the script (template file). how can I refer to
all the files in the topmenu3 folder?
I can't just add the folder name (topmenu3) to the script-references. That does not work.
I perhaps have to adjust the browser-files? I will hardly be able to do that due to minor javascript knowledge.
would be very grateful for help

jscheuer1
05-10-2005, 07:25 AM
Using absolute paths in and for files you wish to access across different directories is just about mandatory. An absolute path looks like this:

http://www.some.com/index.html

To give you more specific help, first I need you to:

.
and:
.

mwinter
05-10-2005, 11:13 AM
An absolute path looks like this:

http://www.some.com/index.htmlActually, that's an absolute URL. That's not the same thing. An absolute path begins with just a slash, and is just as effective: /index.html

Mike

jscheuer1
05-10-2005, 06:57 PM
Actually, that's an absolute URL.Picky but, you are right. Except there are times when an absolute path as you correctly describe it:
/index.htmlcan get you into trouble. Like if your domain is arranged hierarchically over another domain on the same server. Now, not if used properly but, the absolute URL avoids any confusion in cases like that and is so clearly different than a relative path that it is easier to hold in one's mind as an alternative to a relative path. Conversely, sometimes an absolute URL just won't parse properly in a script. IMO that is due to faulty coding but, I have seen it happen with rollovers in Jim's menu, just to mention one spot. In that particular case I've found that this works:
//www.some.com/images/some.gifWhat, if anything, can we call that?

mwinter
05-11-2005, 12:42 AM
[...] there are times when an absolute path as you correctly describe it can get you into trouble. Like if your domain is arranged hierarchically over another domain on the same server.I think I can guess what you're referring to, but I'm not sure. Care to illustrate?



//www.some.com/images/some.gifWhat, if anything, can we call that?A network path.

For the record...

Absolute URLs
There's only one form: scheme://authority/path?query#fragment

Relative URLs
Network path: //authority/path?query#fragment
Absolute path: /path?query#fragment
Relative path: path?query#fragment
Same-document reference: empty URL or #fragment

A query, or query/fragment, part on its own doesn't have it's own name, as far as I know. It's close to a same-document reference, but as different query strings passed to the same resource can return different results, that can hardly be described as a reference to the same document.

Mike

jscheuer1
05-11-2005, 02:53 AM
Boy is the OP ever going to be confused when they read all this stuff we've been posting,

to beinbeisser:

For the purposes of your question you can safely ignore everything except my first response on this, which I know you will. ;)

That out of the way, to give an example of what I was talking about when I said:
...there are times when an absolute path as you correctly describe it can get you into trouble. Like if your domain is arranged hierarchically over another domain on the same server. Now, not if used properly...What I had in mind is a situation like this:

An individual is webmaster for two related sites on the same server. The ftp path for the first is:

ftp://username@some.com/public_html

and the second ftp path to, let's call it 'someother.com' is:

ftp://username@some.com/public_html/arbitrarydirectoryname

using absolute paths in this situation will work but, is overly confusing and will only work correctly if the webmaster understands that on the internet only these two network paths exist:

1) //www.some.com
2) //www.someother.com

My point being an absolute path in a file on someother.com like this:

/some.htm

points to a file in the root of someother.com not some.com as might be incorrectly imagined. Whereas, using the absolute url:

http://www.someother.com/some.htm

makes it 'absolutely' clear what file is being referred to. I had just such a situation on my hands once and, being an old hack at computers decided to test and see what was what, knowing what probably was the case. Others, who are struggling to get a DD menu to work across a single domain might be better off confining themselves to distinguishing between absolute URL's and relative paths. My theory being that, generally, the more options you give to a confused person, the more confused they become.