Index Ask! Random

Question: Frames - How Do I Keep a Dynamic Address Bar?

I have a framed page, and I want to have the address bar of the browser change each time someone clicks a link in the frame. You said that if I want that, I should stop using frames. The problem is, even though I control both the framing page and the framed page, they are on different domains.

Could you give more detail about the "round robin" you talked about?


Why don't I do an example. Let's say you have a domain:, and a domain: And the page is a framing page, and it calls up a frame from the domain (let's say

Now, let's further suppose that the page has a link to . Unfortunately, when someone clicks that link, since it is a change of location within the frame, the address bar of the browser doesn't change. So here's what you do.

Find your hyperlink to the page: - it will look something like this:

<a href="2.asp">Click here to go to page 2</a>

Now change this hyperlink so it looks like this:

<a href="" target="_top">Click here to go to page 2</a>

Notice that you are now sending your visitor back to the framing page on the first domain. Only now there is a query string: location=2. Also note that I've used the target="_top" parameter to escape the frame.

Now you just need to add a bit of script to your framing page:

Dim strFrameURL
select case request("location")
case "2"
case else
end select

Now you can use the variable strFrameURL to point your frame to the right location. You have essentially played "Round Robin" with your two domains - each hyperlink click sends the visitor back to domain A, which then returns them to the appropriate page on domain B.

It's round-about, but now every framed page has a distinct URL, which is what you were hoping for.

Bookmark and Share