base href problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Thies

    base href problems

    I have some pages where I need to use a base href tag.

    Mac behaviour is different than PC.

    I have this:

    <base href="http://some_domain.com " />

    The page would be: some_domain.com/some_directory/some_page.htm

    If I use a relative link:

    <a href="some_othe r_page.htm">som e other page</a>

    IE5 PC goes here: some_domain.com/some_directory/some_other_page .htm

    IE5 Mac goes here:
    some_domain.com/some_other_page .htm

    Which is correct?

    Jeff


  • Peter Foti

    #2
    Re: base href problems

    "Jeff Thies" <nospam@nospam. net> wrote in message
    news:Tqdjb.5698 5$mQ2.43182@new sread1.news.atl .earthlink.net. ..[color=blue]
    > I have some pages where I need to use a base href tag.
    >
    > Mac behaviour is different than PC.
    >
    > I have this:
    >
    > <base href="http://some_domain.com " />
    >
    > The page would be: some_domain.com/some_directory/some_page.htm
    >
    > If I use a relative link:
    >
    > <a href="some_othe r_page.htm">som e other page</a>
    >
    > IE5 PC goes here: some_domain.com/some_directory/some_other_page .htm
    >
    > IE5 Mac goes here:
    > some_domain.com/some_other_page .htm
    >
    > Which is correct?[/color]

    According to the spec:


    I would say the Mac version is correct.

    Regards,
    Peter Foti


    Comment

    • Jukka K. Korpela

      #3
      Re: base href problems

      "Jeff Thies" <nospam@nospam. net> wrote:
      [color=blue]
      > I have some pages where I need to use a base href tag.[/color]

      No, you don't. You never need to use it. It can always be replaced by
      the use of suitable absolute URLs.
      [color=blue]
      > Mac behaviour is different than PC.[/color]

      There are lots of browsers on each platform. Could you give a small
      hint of what you mean, like the first letters of the browser names?
      [color=blue]
      > <base href="http://some_domain.com " />[/color]

      There is currently no such domain. It isn't a suitable fictitious
      sample either, since it lacks the .example indicator.
      [color=blue]
      > The page would be: some_domain.com/some_directory/some_page.htm[/color]

      What page is that? It's a relative URL, which probably means something
      quite different from what you expect.
      [color=blue]
      > If I use a relative link:
      >
      > <a href="some_othe r_page.htm">som e other page</a>
      >
      > IE5 PC goes here: some_domain.com/some_directory/some_other_page .htm[/color]

      No, it does not.
      [color=blue]
      > IE5 Mac goes here:
      > some_domain.com/some_other_page .htm[/color]

      No, it does not.
      [color=blue]
      > Which is correct?[/color]

      Neither. Please post some facts for an analysis, or check the URL
      specifications yourself.

      --
      Yucca, http://www.cs.tut.fi/~jkorpela/
      Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

      Comment

      • Kris

        #4
        Re: base href problems

        In article <Tqdjb.56985$mQ 2.43182@newsrea d1.news.atl.ear thlink.net>,
        "Jeff Thies" <nospam@nospam. net> wrote:
        [color=blue]
        > I have some pages where I need to use a base href tag.
        >
        > Mac behaviour is different than PC.
        >
        > I have this:
        >
        > <base href="http://some_domain.com " />
        >
        > The page would be: some_domain.com/some_directory/some_page.htm
        >
        > If I use a relative link:
        >
        > <a href="some_othe r_page.htm">som e other page</a>
        >
        > IE5 PC goes here: some_domain.com/some_directory/some_other_page .htm
        >
        > IE5 Mac goes here:
        > some_domain.com/some_other_page .htm
        >
        > Which is correct?[/color]

        IE Mac. Seems IE5 PC ignores the BASE element for some reason. Try to
        find out why, because it normally does not ignore it like that.

        --
        Kris
        kristiaan@xs4al l.netherlands (nl)
        "We called him Tortoise because he taught us" said the Mock Turtle.

        Comment

        • Stan Brown

          #5
          Re: base href problems

          In article <Tqdjb.56985$mQ 2.43182@newsrea d1.news.atl.ear thlink.net>
          in comp.infosystem s.www.authoring.html, Jeff Thies
          <nospam@nospam. net> wrote:[color=blue]
          >I have some pages where I need to use a base href tag.[/color]

          May one ask why? Often people jump at that as a solution for a
          particular problem, when in fact a different solution would be
          better.
          [color=blue]
          >Mac behaviour is different than PC.
          ><base href="http://some_domain.com " />
          >The page would be: some_domain.com/some_directory/some_page.htm[/color]
          [color=blue]
          >If I use a relative link:
          ><a href="some_othe r_page.htm">som e other page</a>
          >IE5 PC goes here: some_domain.com/some_directory/some_other_page .htm
          >IE5 Mac goes here: some_domain.com/some_other_page .htm
          >
          > Which is correct?[/color]

          The Mac version. BASE means that any relative URLS should be
          resolved relative to that rather than to the actual URL of the page.

          --
          Stan Brown, Oak Road Systems, Cortland County, New York, USA

          HTML 4.01 spec: http://www.w3.org/TR/html401/
          validator: http://validator.w3.org/
          CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
          2.1 changes: http://www.w3.org/TR/CSS21/changes.html
          validator: http://jigsaw.w3.org/css-validator/

          Comment

          • Daniel R. Tobias

            #6
            Re: base href problems

            Jeff Thies wrote:[color=blue]
            > I have this:
            >
            > <base href="http://some_domain.com " />[/color]

            Well, since domains aren't allowed to have underscores, this can't be an
            actual address. (If you want to cite a hypothetical address, you could
            use one of the RFC-compliant names allocated for this purpose such as
            "example.co m", "example.or g", "whatever.examp le", etc.)

            I would suggest you include the trailing slash in the URI, as
            "http://somedomain.exam ple/"; while it's not mandatory in this case,
            there may be some browser bugs in interpreting relative references to a
            base URI without the slash. (If it were a URI ending in a subdirectory
            name rather than a domain name, the slash would be necessary to cause
            the base to be that directory rather than a filename within the
            directory one level higher.)

            Also, the "/>" ending is valid only in XHTML; if you're using an HTML
            doctype, ">" should be used instead.

            --
            == Dan ==
            Dan's Mail Format Site: http://mailformat.dan.info/
            Dan's Web Tips: http://webtips.dan.info/
            Dan's Domain Site: http://domains.dan.info/

            Comment

            • Alan J. Flavell

              #7
              Re: base href problems

              On Fri, 17 Oct 2003, Daniel R. Tobias wrote:
              [color=blue]
              > I would suggest you include the trailing slash in the URI, as
              > "http://somedomain.exam ple/"[/color]

              <pedant>
              Actually, that's not _the_ trailing slash: that's the slash which
              separates the domain part of the URL from the URLpath part, as in


              Just that in this case, the URLpath part is null, but you can imagine
              it standing there - to the right of this non-trailing slash ;-)

              These two URLs, http://somedomain.example/path/to/whatever and
              http://somedomain.example/path/to/whatever/ are definitively
              different: they differ by the latter having a trailing slash.

              But thes URLs, http://somedomain.example and
              http://somedomain.example/ are defined to be identical: they
              differ only by omitting the slash which separates the domain part from
              the URLpath part, and _that_ slash is optional when the URLpath part
              is empty.

              </pedant>
              [color=blue]
              > ; while it's not mandatory in this case,[/color]

              right
              [color=blue]
              > there may be some browser bugs in interpreting relative references to a
              > base URI without the slash.[/color]

              I'm not disagreeing with that. Just quibbling over terminology.

              cheers

              Comment

              Working...