Results 1 to 6 of 6

Thread: directing dependent files to folder

  1. #1
    Join Date
    May 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default directing dependent files to folder

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.
    and:
    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    An absolute path looks like this:

    http://www.some.com/index.html
    Actually, 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

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Mike
    Actually, that's an absolute URL.
    Picky but, you are right. Except there are times when an absolute path as you correctly describe it:
    Quote Originally Posted by Mike
    /index.html
    can 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:
    Code:
    //www.some.com/images/some.gif
    What, if anything, can we call that?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    [...] 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?

    Code:
    //www.some.com/images/some.gif
    What, 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

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:
    Quote Originally Posted by John (me)
    ...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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •