Results 1 to 3 of 3

Thread: frameset and URL in address bar

  1. #1
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default frameset and URL in address bar

    Hello everybody,
    I'm experimenting with framesets and noticed that:
    <a href="bla.html" onclick='top.location.href="#bla.html"'>bla</a>
    gives me a new URL in the top location bar (as desired), even if the targeted frame is not _top (but the main frame).
    Now, this method adds an extra entry to the history. That is, if I have, for example, '../index.html' in the address bar (and 'index.html' in the main frame) before clicking on the bla link, then, after clicking on the bla-link, I have '..index.html#bla.html', then if I go back (back button) I still have the content of bla.html in the main frame, but the URL in the address bar has already returned to '../index.html'. I have to do an extra 'back in history' to get 'index.html' in the main frame again.
    In other words, the method works well, except for the extra entry I want to get rid of (in the history queue). (The replace-method doesn't work here, since it deletes the history). Any ideas on how to solve this?

    Thanks,
    Arie Molendijk.

  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

    Not sure I get you. The location.replace method only gets rid of the current page's spot in the history, replacing it with the new page. It doesn't wipe out the entire history.

    Frames are being deprecated though, and these sort of issues may well be one of the reasons.
    - John
    ________________________

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

  3. #3
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    You're right about replace!.
    I'm experimenting with framesets, since we would have the same problems with iframes. What I am actually after is the possibility of loading a page in an iframe (with 'target="main"' (not:_top)), then have the URL of the top location bar adapt to the URL of the document loaded in the iframe, where the 'adaption' must be achieved without a reload of the parent page (that contains the iframe).

    Arie Molendijk.

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
  •