breaking out of frameset problem

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

    #1

    breaking out of frameset problem

    Hi,

    I use the following code to force the page to load into the intended
    frameset (navigation purposes) if visitors come to pages in a certain
    section of the site from search engines/external links.

    <script language="JavaS cript"><!--
    if (parent.locatio n.href == self.location.h ref)
    window.location .href = 'index.htm?page one';
    //--></script>

    This works very well BUT.... if the visitor hits the browser back button all
    it does is reload the page and frameset unless you either use the onsite
    navigation or call up the previous pages with the carat by the back button.

    Is there any way of making sure that if the visitor simply hits the back
    button they break out of the frameset and return to wherever they cam from?

    Thanks


  • Lasse Reichstein Nielsen

    #2
    Re: breaking out of frameset problem

    "David" <david.brown666 6@ntlworld.com> writes:
    [color=blue]
    > Hi,
    >
    > I use the following code to force the page to load into the intended
    > frameset (navigation purposes) if visitors come to pages in a certain
    > section of the site from search engines/external links.
    >
    > <script language="JavaS cript"><!--
    > if (parent.locatio n.href == self.location.h ref)
    > window.location .href = 'index.htm?page one';
    > //--></script>
    >
    > This works very well BUT.... if the visitor hits the browser back button all
    > it does is reload the page and frameset unless you either use the onsite
    > navigation or call up the previous pages with the carat by the back button.
    >
    > Is there any way of making sure that if the visitor simply hits the back
    > button they break out of the frameset and return to wherever they cam from?[/color]


    Try
    if (top == self) {
    location.replac e('index.htm?pa geone');
    }

    Using location.replac e means that the current page is replaced, even
    in the history, with the new one.

    Consider whether it is a good idea to force how people see your page,
    and that your frameset depends on javascript. Perhaps you should have
    a different frameset for this that depends on javascript, and a
    non-javascript one for people who enter at the front page.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...