Forum Moderators: DixonJones

Message Too Old, No Replies

Back button on Breaking out of Frames.

BB not disabled, but visitors bounce back and forth.

         

larryhatch

5:39 am on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A related site decided to puy my site up in frames.
I found this offensive, since I have a straight link the them.
Now all my pages break out of frames.

Problem is that people hit the back button (which still works) and get into bounce mode!
They return to sender, and are framed right back to my pages in an endless loop.

This screws up my hit counts etc., and no doubt ticks off the visitors.

IS there some way to back button TWO places, ZERO places ..
i.e. anything EXCEPT the referring page?

I'm trying to break that endless loop.

Thanks in advance - Larry

Zaphod Beeblebrox

1:05 pm on Dec 27, 2004 (gmt 0)

10+ Year Member



<a href="javascript:history.back(2)">Back</a>

larryhatch

6:56 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Beeblebrock:

THAT could be the answer I have been looking for!

Where exactly do I put that in my code?
My index.html is just that, straight well validated html 4.01.

Can you give me the syntax / context? Thanks is advance. - Larry

larryhatch

7:08 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh! One important thing.

I ONLY want to do this if my page was called up inside somebody else's frame.
Otherwise, I will screw up the majority of visitors who came in via honest links.

Thanks again! - Larry

keyplyr

10:03 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Try this:

if (parent.frames.length > 0) {
parent.location.href = location.href;
}

Back button should not be affected, but I have no environment to test it on. Haven't seen a frames page in ages.

larryhatch

11:10 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi keyplyr:

I already have a code that breaks out of frames without affecting the back key.
Please see my original message at the top.

Problem is an endless loop until user stops hitting the back key.

- Larry

keyplyr

11:57 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




Problem is an endless loop until user stops hitting the back key

Maybe someday we'll be able to run scripts on the user himself :)

larryhatch

12:00 pm on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What gets me, is that the visitor is liable to blame MY site for the endless loop,
when it was the $%^&* REFERRING site that caused the problem! - Larry

amznVibe

1:08 pm on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use the javascript REPLACE function to change the url.
On most browsers, this takes the current page out of the history entirely, so the back button will jump all the way back properly.

parent.location.replace(location.href)

(untested)