Slashes in file names

Discussion in 'HTML' started by tshad, Mar 1, 2005.

  1. tshad

    tshad Guest

    Does it matter which slash (forward or back) in my urls or files?

    I have both set up that seem to work interchangeably. But someone said this
    was not the right way to do this.

    For example:

    <tr height="90px"
    style="padding:0;background:url('../images/StaffingLogo_bg3.jpg')">
    <td width="424px"><img src="..\images\StaffingLogo_FG3.jpg" width="424px"
    height="90px">

    Thanks,

    Tom
    tshad, Mar 1, 2005
    #1
    1. Advertising

  2. tshad

    saz Guest

    In article <x42Vd.8217$>,
    says...
    > Does it matter which slash (forward or back) in my urls or files?
    >
    > I have both set up that seem to work interchangeably. But someone said this
    > was not the right way to do this.
    >
    > For example:
    >
    > <tr height="90px"
    > style="padding:0;background:url('../images/StaffingLogo_bg3.jpg')">
    > <td width="424px"><img src="..\images\StaffingLogo_FG3.jpg" width="424px"
    > height="90px">
    >
    > Thanks,
    >
    > Tom
    >
    >
    >

    Forward "/" is for internet use, or for files located outside your
    network and computer.

    Backwards "\" is for local networks and your personal computer.
    saz, Mar 1, 2005
    #2
    1. Advertising

  3. saz wrote:

    > Backwards "\" is for local networks


    .... depending on protocol.

    > and your personal computer.


    .... assuming you use Windows. UNIX based systems (like Linux, BSD or Mac OS
    X) use forward slashes as directory seperators.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Mar 1, 2005
    #3
  4. tshad

    tshad Guest

    "saz" <> wrote in message
    news:...
    > In article <x42Vd.8217$>,
    > says...
    >> Does it matter which slash (forward or back) in my urls or files?
    >>
    >> I have both set up that seem to work interchangeably. But someone said
    >> this
    >> was not the right way to do this.
    >>
    >> For example:
    >>
    >> <tr height="90px"
    >> style="padding:0;background:url('../images/StaffingLogo_bg3.jpg')">
    >> <td width="424px"><img src="..\images\StaffingLogo_FG3.jpg"
    >> width="424px"
    >> height="90px">
    >>
    >> Thanks,
    >>
    >> Tom
    >>
    >>
    >>

    > Forward "/" is for internet use, or for files located outside your
    > network and computer.
    >
    > Backwards "\" is for local networks and your personal computer.


    So when I am getting images or going from page to page (redirects) on my
    system I should always use "\", correct?

    When I use http:, I should always use http://xxx/xx/.

    Thanks,

    Tom
    tshad, Mar 1, 2005
    #4
  5. tshad wrote:
    > So when I am getting images or going from page to page (redirects) on my
    > system I should always use "\", correct?


    A relative URL is still a relative URL - so no.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Mar 1, 2005
    #5
  6. tshad

    Toby Inkster Guest

    tshad wrote:

    > Does it matter which slash (forward or back) in my urls or files?


    Use forward slashes.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Mar 1, 2005
    #6
  7. tshad

    tshad Guest

    "David Dorward" <> wrote in message
    news:d02f4m$9e9$3$...
    > tshad wrote:
    >> So when I am getting images or going from page to page (redirects) on my
    >> system I should always use "\", correct?

    >
    > A relative URL is still a relative URL - so no.


    What about if I want it to be relative to the root folder (not c:, but the
    virtual directory root)?

    Something like:

    <script language="javascript" src="\includes\Menus.js"></script>

    Where the menu structure would be "c:\inetpub\wwwroot\development\includes".

    I don't want to use "c:\inetpub\wwwroot\development" because the production
    name might be different.

    Tom

    >
    > --
    > David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    > Home is where the ~/.bashrc is
    tshad, Mar 1, 2005
    #7
  8. On Tue, 01 Mar 2005 12:06:19 -0600, saz wrote:

    > In article <x42Vd.8217$>,
    > says...
    >> Does it matter which slash (forward or back) in my urls or files?
    >>
    >> I have both set up that seem to work interchangeably. But someone said this
    >> was not the right way to do this.
    >>
    >> For example:
    >>
    >> <tr height="90px"
    >> style="padding:0;background:url('../images/StaffingLogo_bg3.jpg')">
    >> <td width="424px"><img src="..\images\StaffingLogo_FG3.jpg" width="424px"
    >> height="90px">
    >>
    >> Thanks,
    >>
    >> Tom
    >>
    >>
    >>

    > Forward "/" is for internet use, or for files located outside your
    > network and computer.
    >
    > Backwards "\" is for local networks and your personal computer.


    Actually the "\" is used in windows environments. Possibly some others as
    well. I can't comment about the mac line, but in linux, my OS of choice,
    / is used for directories, servers, and so forth.

    Carolyn
    Carolyn Marenger, Mar 1, 2005
    #8
  9. tshad

    tshad Guest

    "tshad" <> wrote in message
    news:AB3Vd.10442$...
    > "David Dorward" <> wrote in message
    > news:d02f4m$9e9$3$...
    >> tshad wrote:
    >>> So when I am getting images or going from page to page (redirects) on my
    >>> system I should always use "\", correct?

    >>
    >> A relative URL is still a relative URL - so no.

    >
    > What about if I want it to be relative to the root folder (not c:, but the
    > virtual directory root)?
    >
    > Something like:
    >
    > <script language="javascript" src="\includes\Menus.js"></script>
    >
    > Where the menu structure would be
    > "c:\inetpub\wwwroot\development\includes".
    >
    > I don't want to use "c:\inetpub\wwwroot\development" because the
    > production name might be different.


    I read in another article that you could use "~//", but that doesn't seem to
    work here:

    <script language="javascript" src="~//includes/Menus.js"></script>

    Tom
    >
    > Tom
    >
    >>
    >> --
    >> David Dorward <http://blog.dorward.me.uk/>
    >> <http://dorward.me.uk/>
    >> Home is where the ~/.bashrc is

    >
    >
    tshad, Mar 1, 2005
    #9
  10. tshad

    Dylan Parry Guest

    tshad wrote:

    > <script language="javascript" src="\includes\Menus.js"></script>


    Nope. You still use "/" here. Any time you use a slash within HTML
    code[1], it should be a forward slash.

    ____
    1. Except when you are actually attempting to display the backslash
    character in, for example, a paragraph of text.

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
    Dylan Parry, Mar 1, 2005
    #10
  11. tshad

    JDS Guest

    On Tue, 01 Mar 2005 19:00:58 +0000, tshad wrote:

    > So when I am getting images or going from page to page (redirects) on my
    > system I should always use "\", correct?
    >
    > When I use http:, I should always use http://xxx/xx/.
    >
    > Thanks,
    >
    > Tom


    Inside HTML pages and CSS, *always* use forward slashes. "/" -- on the
    question mark key. So for your original example, ALL of the slashes
    should be forward-slashes! ALL OF THEM. The text was text inside an HTML
    page. HTML only uses the forward-slash as a directory delimeter.

    If you have a Windows PC, use Back-slashes in, for example, Windows
    Explorer, to navigate directories, or on the MS-DOS command prompt. "\" --
    on the "pipe" key, usually.

    Technically speaking, to answer the Subject: line of the OP, "slashes" are
    not part of the file name. They indicate the file path.

    --
    JDS | lid
    | http://www.newtnotes.com
    DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
    JDS, Mar 1, 2005
    #11
  12. tshad

    JDS Guest

    On Tue, 01 Mar 2005 19:49:23 +0000, tshad wrote:

    >
    > I read in another article that you could use "~//", but that doesn't seem to
    > work here:
    >
    > <script language="javascript" src="~//includes/Menus.js"></script>


    The tilde ("~") character is a Unix-ism (and Linux, too) that means "My
    Home Directory". Tilde is (essentially) meaningless on Windows.

    The extra slash is probably just a typo -- the only time you use two
    slashes is between the protocol indicator ("http:" or "ftp:" for example)
    and the path.

    --
    JDS | lid
    | http://www.newtnotes.com
    DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
    JDS, Mar 1, 2005
    #12
  13. tshad

    JDS Guest

    JDS, Mar 1, 2005
    #13
  14. JDS wrote:

    > The tilde ("~") character is a Unix-ism (and Linux, too) that means
    > "My Home Directory". Tilde is (essentially) meaningless on Windows.


    To the extent that to most Windows users, it's probably "that little
    wavy thing."

    --
    Blinky Linux Registered User 297263
    Who has implemented Usenet Solution #45933:
    Now killing all posts originating at Google Groups
    Blinky the Shark, Mar 1, 2005
    #14
  15. tshad

    Toby Inkster Guest

    Carolyn Marenger wrote:
    > saz wrote:
    >
    >> Forward "/" is for internet use, or for files located outside your
    >> network and computer.
    >>
    >> Backwards "\" is for local networks and your personal computer.

    >
    > Actually the "\" is used in windows environments. Possibly some others
    > as well. I can't comment about the mac line, but in linux, my OS of
    > choice, / is used for directories, servers, and so forth.


    Actually, on the DOS/Windows filesystem, "/" and "\" are interchangeable,
    though "\" is convention. And some particular DOS/Windows applications
    will insist on a "\".

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, Mar 1, 2005
    #15
  16. tshad

    Dan Guest

    tshad wrote:
    > What about if I want it to be relative to the root folder (not c:,

    but the
    > virtual directory root)?
    >
    > Something like:
    >
    > <script language="javascript" src="\includes\Menus.js"></script>


    URLs always use forward slashes. Even "file:" URLs referring to local
    system files use forward slashes even though the local operating system
    convention might use backslashes.

    For relative URLs to the root, you would use
    src="/includes/Menus.js".

    --
    Dan
    Dan, Mar 1, 2005
    #16
  17. tshad

    tshad Guest

    "Dylan Parry" <> wrote in message
    news:...
    > tshad wrote:
    >
    >> <script language="javascript" src="\includes\Menus.js"></script>

    >
    > Nope. You still use "/" here. Any time you use a slash within HTML
    > code[1], it should be a forward slash.
    >


    But that still doesn't find the root directory (at least, I can't seem to
    make it work).

    > ____
    > 1. Except when you are actually attempting to display the backslash
    > character in, for example, a paragraph of text.
    >
    > --
    > Dylan Parry
    > http://webpageworkshop.co.uk -- FREE Web tutorials and references
    tshad, Mar 1, 2005
    #17
  18. tshad wrote:

    >> Nope. You still use "/" here. Any time you use a slash within HTML
    >> code[1], it should be a forward slash.


    > But that still doesn't find the root directory (at least, I can't seem to
    > make it work).


    It should find the root directory, of course if you are accessing it over
    your local file system then the root is c:\ (or whatever drive it is). You
    are usually best off installing a local webserver
    <http://httpd.apache.org/> for testing if you want to use root relative
    URIs.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Mar 1, 2005
    #18
  19. tshad

    JDS Guest

    On Tue, 01 Mar 2005 20:12:53 +0000, Blinky the Shark wrote:

    > To the extent that to most Windows users, it's probably "that little
    > wavy thing."


    Right. I can't tell you how many times I would read out a URL that had a
    tilde in it (personal home page or whatever) to someone on the phone and
    they would say "not working not working not working" and I'd find out
    later that they had actually typed the *word* "tilde" in the URL

    e.g. http://example.com/tildejeff

    instead of
    http://example.com/~jeff

    And I would go over and poke their eyes out and rescind their computer use
    privileges and poop on their 5-and-a-quarters[1] and have my cat pee in
    their punchcard reader (assuming that they had that particularly advanced
    I/O device) and and then I'd yell at them and tell them that their momma
    was a Timex Sinclair and then I'd really get mad and mess them up. yeah.
    Then I'd put my Apple IIc in their butt sideways and tell them to take it
    up with Jef Raskin. Ah...how I loved that IIc.


    [1] Don't know what that is? Sheesh.

    --
    JDS | lid
    | http://www.newtnotes.com
    DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
    JDS, Mar 1, 2005
    #19
  20. tshad

    JDS Guest

    On Tue, 01 Mar 2005 21:21:33 +0000, David Dorward wrote:

    > It should find the root directory, of course if you are accessing it over
    > your local file system then the root is c:\ (or whatever drive it is). You
    > are usually best off installing a local webserver
    > <http://httpd.apache.org/> for testing if you want to use root relative
    > URIs.


    Ah, yes. Good advice.

    --
    JDS | lid
    | http://www.newtnotes.com
    DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
    JDS, Mar 1, 2005
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nils N

    Using slashes as querystring

    Nils N, Feb 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,891
    Nils N
    Feb 8, 2004
  2. Henrik de Jong
    Replies:
    0
    Views:
    363
    Henrik de Jong
    Jun 18, 2004
  3. qazmlp
    Replies:
    5
    Views:
    678
    Michael Dunn
    Apr 7, 2004
  4. Julie
    Replies:
    10
    Views:
    569
    Derek
    Apr 13, 2004
  5. Dan Wilkin
    Replies:
    1
    Views:
    248
    robic0
    Jul 17, 2006
Loading...

Share This Page