/    Sign up×
Community /Pin to ProfileBookmark

force frames and url update

Heya

I have a to part problem. I am making a webpage that uses two iframes. “Left” iframe for navigation, and “body” iframe that displayes all my pages.

There is a navigation bar that controls the “left” iframe and also loads a page in the “body” iframe. And the navigation page in “left” then gives you more places to go that load into “body” iframe.

What I would like:

  • 1.

    When I travel around my own I would like to have the url reflect the page thats presently in the “body” iframe. Now it alwayes shows the mypage.com. Thinking i need some function that when I follow a link it at the same time updates the url. Just dont know how to do it.

  • 2.

    Now that someone has the actual direct link to a page of mine, the problem is they load outside my frame, course I want to prevent that. But I need the js to force the page back to frame (that i can actually manage), but also to update “left” iframe with the correct navX.htm and the url.

  • Sorry it got a little longwinded, hope someone is able to help me out.
    Thanks in advance

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @7studDec 01.2004 — 
  • 1. The url doesn't work that way: whatever page you see in the address bar is going to be the page that is displayed in the main page.


  • 2. (no idea what you are talking about)
  • Copy linkTweet thisAlerts:
    @aeetesauthorDec 01.2004 — I probably over explained myself, sorry.

    1) Is there a way to avoid url masking? I want the url to show the address of the page in my iframe.

    2)I know a can make a page that is loaded outside its iframe return like this:

    if (parent.location.href == self.location.href){window.location.href = 'index.html'

    What i would like it to do while doing that, is to load another.html into a second iframe. (also in index.htm ofcourse)

    Hope that clears it up a little.

    Thanks for looking at it anyway.
    ×

    Success!

    Help @aeetes spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...