FAQ Topic - How do I change the text in the url/location bar?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • FAQ server

    FAQ Topic - How do I change the text in the url/location bar?

    -----------------------------------------------------------------------
    FAQ Topic - How do I change the text in the url/location bar?
    -----------------------------------------------------------------------

    This text can only be altered by changing the URL of the page.
    The normal solution is to use frames, though this can introduce
    problems of its own.


    ===
    Postings such as this are automatically sent once a day. Their
    goal is to answer repeated questions, and to offer the content to
    the community for continuous evaluation/improvement. The complete
    comp.lang.javas cript FAQ is at http://www.jibbering.com/faq/.
    The FAQ workers are a group of volunteers.

  • Randy Webb

    #2
    Re: FAQ Topic - How do I change the text in the url/location bar?

    FAQ server said the following on 1/7/2007 7:00 PM:
    -----------------------------------------------------------------------
    FAQ Topic - How do I change the text in the url/location bar?
    -----------------------------------------------------------------------
    >
    This text can only be altered by changing the URL of the page.
    The normal solution is to use frames, though this can introduce
    problems of its own.
    The second statement doesn't even come close to answering the question.
    It is almost totally irrelevant to the question asked. Frames are the
    "normal solution" *not* to change the text in the url/location bar.
    Although there are other "solutions" now, IFrame/AJAX/Loading JS
    Files/etc...
    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

    Comment

    • Richard Cornford

      #3
      Re: FAQ Topic - How do I change the text in the url/location bar?

      Randy Webb wrote:
      FAQ server said the following on 1/7/2007 7:00 PM:
      >---------------------------------------------------------------------
      --
      >FAQ Topic - How do I change the text in the url/location bar?
      >---------------------------------------------------------------------
      --
      >>
      >This text can only be altered by changing the URL of the page.
      >The normal solution is to use frames, though this can introduce
      >problems of its own.
      >
      The second statement doesn't even come close to answering the
      question. It is almost totally irrelevant to the question asked.
      Frames are the "normal solution" *not* to change the text in the
      url/location bar. Although there are other "solutions" now,
      IFrame/AJAX/Loading JS Files/etc...
      Frames (which include IFRAME elements) can be used to control the URL
      shown in the location bar. If you want to show contents at one location
      and the URL of another then (navigating to) a page at the URL that is to
      go into the location bar that has a frame pointing the URL of the
      desired content achieves that.

      Richard.


      Comment

      • Randy Webb

        #4
        Re: FAQ Topic - How do I change the text in the url/location bar?

        Richard Cornford said the following on 1/7/2007 8:15 PM:
        Randy Webb wrote:
        >FAQ server said the following on 1/7/2007 7:00 PM:
        >>---------------------------------------------------------------------
        --
        >>FAQ Topic - How do I change the text in the url/location bar?
        >>---------------------------------------------------------------------
        --
        >>This text can only be altered by changing the URL of the page.
        >>The normal solution is to use frames, though this can introduce
        >>problems of its own.
        >The second statement doesn't even come close to answering the
        >question. It is almost totally irrelevant to the question asked.
        >Frames are the "normal solution" *not* to change the text in the
        >url/location bar. Although there are other "solutions" now,
        >IFrame/AJAX/Loading JS Files/etc...
        >
        Frames (which include IFRAME elements) can be used to control the URL
        shown in the location bar.
        In the sense it hides/masks the URL then it controls it.
        If you want to show contents at one location and the URL of another
        then (navigating to) a page at the URL that is to go into the location
        bar that has a frame pointing the URL of the desired content achieves that.
        That is very true but doesn't answer the question that is asked. While
        it "controls" the URL, it doesn't actually change it, it merely
        hides/masks the true URL. And there are other methods to achieve that
        that are not mentioned. AJAX being one of them.

        The question it does answer is "How do I mask/hide the true URL of the
        page?"

        And, if the FAQ Entry is designed to answer how to hide/mask the URL
        then shouldn't the question be changed?

        --
        Randy
        Chance Favors The Prepared Mind
        comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
        Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

        Comment

        • Roy A.

          #5
          Re: FAQ Topic - How do I change the text in the url/location bar?


          FAQ server skrev:
          -----------------------------------------------------------------------
          FAQ Topic - How do I change the text in the url/location bar?
          -----------------------------------------------------------------------
          >
          This text can only be altered by changing the URL of the page.
          The normal solution is to use frames, though this can introduce
          problems of its own.
          I don't think you can do that without a round-trip to the server. The
          normal solution is to use url rewrite or custom error pages. With
          frames, the frameset page would have to be a real url with a frameset
          document.

          With custom error pages you could use JavaScript to submit a form with
          a real location to a non existing url on the domain. Then, on the
          server, you could use JavaScript to include the real page.

          Comment

          • Randy Webb

            #6
            Re: FAQ Topic - How do I change the text in the url/location bar?

            Roy A. said the following on 1/8/2007 7:49 AM:
            FAQ server skrev:
            >-----------------------------------------------------------------------
            >FAQ Topic - How do I change the text in the url/location bar?
            >-----------------------------------------------------------------------
            >>
            >This text can only be altered by changing the URL of the page.
            >The normal solution is to use frames, though this can introduce
            >problems of its own.
            >
            I don't think you can do that without a round-trip to the server.
            Actually, you can. An anchor within a page will change the text in the
            url/location bar but it won't make a round-trip to the server. The FAQ
            itself uses anchors :)
            The normal solution is to use url rewrite or custom error pages. With
            frames, the frameset page would have to be a real url with a frameset
            document.
            That is not entirely true. If the custom error page uses url rewrite to
            point to the true frameset page...
            With custom error pages you could use JavaScript to submit a form with
            a real location to a non existing url on the domain. Then, on the
            server, you could use JavaScript to include the real page.
            I think (and not totally positive) that what got that question into the
            FAQ to begin with was people asking how to hide the true URL of the
            page. With the advent and popularity of the XMLHttpRequest Object you
            don't see that question asked very often anymore.

            In either event, the question has become mostly moot but the answer in
            the FAQ doesn't begin to cover the possibilities of leaving the URL
            intact while changing the page.
            --
            Randy
            Chance Favors The Prepared Mind
            comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
            Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

            Comment

            Working...