Way to Redirect Framed Page???

Discussion in 'HTML' started by DiLu790, Dec 14, 2003.

  1. DiLu790

    DiLu790 Guest

    Hello, someone's framed one of my pages within their site. Although it may very
    well be a compliment, I don't like it considering the possible repercussions it
    may have on my great rankings at Google.

    I dug up the following which DOES work:

    <script language="Javascript">
    <!-- hide this from non JavaScript Browsers
    if (window.location != top.location)
    {top.location.href=window.location}
    // -->
    </script>

    But might there be a way to redirect the page to a different page (which in my
    case would be a blank page) if it's being framed? Or is that impossible?
    DiLu790, Dec 14, 2003
    #1
    1. Advertising

  2. DiLu790

    Cameron Guest

    DiLu790 wrote:
    > Hello, someone's framed one of my pages within their site. Although it may very
    > well be a compliment, I don't like it considering the possible repercussions it
    > may have on my great rankings at Google.
    >
    > I dug up the following which DOES work:
    >
    > <script language="Javascript">
    > <!-- hide this from non JavaScript Browsers
    > if (window.location != top.location)
    > {top.location.href=window.location}
    > // -->
    > </script>
    >
    > But might there be a way to redirect the page to a different page (which in my
    > case would be a blank page) if it's being framed? Or is that impossible?
    >


    not sure if this will do what you want but you can put a meta tag to
    redirect in the <head> section of the page, this may just reload inside
    the frame, I aren't sure about that, never use frames can't stand the
    pesky little creatures.

    <META http-equiv="refresh" content="3;URL=http://www.foo.com/bar/index.htm">


    Hope that's correct, haven't used it manually for a long time.

    that will redirect them to http://www.foo.com/bar/index.htm in 3
    seconds, but be warned that all browsers may not honor the redirect,
    either by user preference or design, they SHOULD but just in case you
    should put a link as well like

    <a href="http://www.foo.com/bar/index.htm">If you are not redirected in
    3 seconds click here</a>

    ~Cameron
    Cameron, Dec 14, 2003
    #2
    1. Advertising

  3. DiLu790

    Sid Ismail Guest

    On 14 Dec 2003 21:51:37 GMT, (DiLu790) wrote:

    : <script language="Javascript">
    : <!-- hide this from non JavaScript Browsers
    : if (window.location != top.location)
    : {top.location.href=window.location}
    : // -->
    : </script>
    :
    : But might there be a way to redirect the page to a different page (which in my
    : case would be a blank page) if it's being framed? Or is that impossible?


    If framed, redirect them to a porn site... if I were you. Swines.

    Sid
    Sid Ismail, Dec 14, 2003
    #3
  4. DiLu790 wrote:
    > Hello, someone's framed one of my pages within their site. Although
    > it may very well be a compliment, I don't like it considering the
    > possible repercussions it may have on my great rankings at Google.
    >
    > I dug up the following which DOES work:
    >
    > <script language="Javascript">
    > <!-- hide this from non JavaScript Browsers
    > if (window.location != top.location)
    > {top.location.href=window.location}
    > // -->
    > </script>
    >
    > But might there be a way to redirect the page to a different page
    > (which in my case would be a blank page) if it's being framed? Or is
    > that impossible?


    <script type="text/javascript">
    if (window.location != top.location) {
    window.location = "blank.html";
    }
    </script>

    Andrew Graham
    Andrew Graham, Dec 14, 2003
    #4
  5. DiLu790

    Sid Ismail Guest

    On Sun, 14 Dec 2003 22:04:18 +0000, Cameron <>
    wrote:

    : not sure if this will do what you want but you can put a meta tag to
    : redirect in the <head> section of the page, this may just reload inside
    : the frame, I aren't sure about that, never use frames can't stand the
    : pesky little creatures.
    :
    : <META http-equiv="refresh" content="3;URL=http://www.foo.com/bar/index.htm">


    And have an endless loop ??

    Sid
    Sid Ismail, Dec 14, 2003
    #5
  6. DiLu790

    Cameron Guest

    Sid Ismail wrote:
    > On Sun, 14 Dec 2003 22:04:18 +0000, Cameron <>
    > wrote:
    >
    > : not sure if this will do what you want but you can put a meta tag to
    > : redirect in the <head> section of the page, this may just reload inside
    > : the frame, I aren't sure about that, never use frames can't stand the
    > : pesky little creatures.
    > :
    > : <META http-equiv="refresh" content="3;URL=http://www.foo.com/bar/index.htm">
    >
    >
    > And have an endless loop ??
    >
    > Sid
    >


    Wasn't really 100% sure what was being asked, I never use frames, if I
    need e.g. a constant set of links down the left hand side I just layout
    a global page template and use PHP's include function to do so, also
    never learned javascript because I prefer things to be done at the
    server for compatibility reasons, Lynx still exists ya know ;), so I was
    just offering what I could, not a definite this will work method.

    ~Cameron
    Cameron, Dec 14, 2003
    #6
  7. DiLu790

    DiLu790 Guest

    Wow!

    That worked perfectly!

    Thanks a bunch Andrew.
    DiLu790, Dec 14, 2003
    #7
  8. Cameron wrote:

    > Sid Ismail wrote:
    >
    >> On Sun, 14 Dec 2003 22:04:18 +0000, Cameron
    >> <> wrote:
    >>
    >>: <META http-equiv="refresh"
    >>: content="3;URL=http://www.foo.com/bar/index.htm">
    >>
    >> And have an endless loop ??

    >
    > never learned javascript because I prefer things to be done at the
    > server for compatibility reasons, Lynx still exists ya know ;),


    Although to clarify, Lynx does support meta refresh.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Dec 14, 2003
    #8
  9. DiLu790

    DiLu790 Guest

    Hey Sid,

    yah, I know what you mean...and I AM Tempted, but not sure if this person(s)
    meant it as a compliment or to cause trouble.

    thus, I think I'll take the gracious route.

    Thanks for your input.
    DiLu790, Dec 14, 2003
    #9
  10. DiLu790

    Sid Ismail Guest

    On 14 Dec 2003 23:30:39 GMT, (DiLu790) wrote:

    : Hey Sid,
    :
    : yah, I know what you mean...and I AM Tempted, but not sure if this person(s)
    : meant it as a compliment or to cause trouble.
    :
    : thus, I think I'll take the gracious route.


    LOL - you're a gentleman.

    Sid
    Sid Ismail, Dec 15, 2003
    #10
  11. DiLu790

    Cameron Guest

    Toby A Inkster wrote:
    > Cameron wrote:
    >
    >
    >>Sid Ismail wrote:
    >>
    >>
    >>>On Sun, 14 Dec 2003 22:04:18 +0000, Cameron
    >>><> wrote:
    >>>
    >>>: <META http-equiv="refresh"
    >>>: content="3;URL=http://www.foo.com/bar/index.htm">
    >>>
    >>>And have an endless loop ??

    >>
    >>never learned javascript because I prefer things to be done at the
    >>server for compatibility reasons, Lynx still exists ya know ;),

    >
    >
    > Although to clarify, Lynx does support meta refresh.
    >


    Ayep, lynx is standards compliant, I was saying it doesn't support
    javascript or frames for that matter.

    ~Cameron
    Cameron, Dec 15, 2003
    #11
  12. DiLu790

    A Hess Guest

    Somewhere around 12/14/03 2:29 PM, Sid Ismail typed wildly with reckless
    abandon:


    >
    > If framed, redirect them to a porn site... if I were you. Swines.
    >
    > Sid
    >


    Or goatse or tubgirl, in extreme cases *shudder*

    --
    Our greatest glory is not in never failing, but in rising every time we
    fail. - Confucius
    A Hess, Dec 15, 2003
    #12
  13. Cameron wrote:
    >> Although to clarify, Lynx does support meta refresh.

    >
    > Ayep, lynx is standards compliant, I was saying it doesn't support
    > javascript or frames for that matter.


    Which HTTP standard is the Refresh header in? It's non-standard.
    Leif K-Brooks, Dec 15, 2003
    #13
  14. DiLu790

    Cameron Guest

    Leif K-Brooks wrote:
    > Cameron wrote:
    >
    >>> Although to clarify, Lynx does support meta refresh.

    >>
    >>
    >> Ayep, lynx is standards compliant, I was saying it doesn't support
    >> javascript or frames for that matter.

    >
    >
    > Which HTTP standard is the Refresh header in? It's non-standard.
    >


    Well the refresh header is mentioned in the HTML 4.0 specification
    stating that some user agents support it.

    http://www.w3.org/TR/1998/REC-html40-19980424/html40.txt

    ~Cameron
    Cameron, Dec 15, 2003
    #14
  15. Cameron wrote:
    > Well the refresh header is mentioned in the HTML 4.0 specification
    > stating that some user agents support it.


    The HTML standard has no authority over it, it's an HTTP issue. HTML
    doesn't say it's a real standard anyway, just that some browsers support it.
    Leif K-Brooks, Dec 15, 2003
    #15
  16. DiLu790

    Cameron Guest

    Leif K-Brooks wrote:

    > Cameron wrote:
    >
    >> Well the refresh header is mentioned in the HTML 4.0 specification
    >> stating that some user agents support it.

    >
    >
    > The HTML standard has no authority over it, it's an HTTP issue. HTML
    > doesn't say it's a real standard anyway, just that some browsers support
    > it.
    >


    Hmm ok then, I more than likely saw it when I was skimming through the
    HTML specification as I have done once or twice, or maybe I just
    presumed it was part of the specification, who can tell, but I will
    admit I was w..I was....wrong, *Ouch* ;)

    ~Cameron
    Cameron, Dec 15, 2003
    #16
  17. Cameron <> wrote in message news:<brimor$p73$>...
    > DiLu790 wrote:
    > > Hello, someone's framed one of my pages within their site. Although it may very
    > > well be a compliment, I don't like it considering the possible repercussions it
    > > may have on my great rankings at Google.
    > >
    > > I dug up the following which DOES work:
    > >
    > > <script language="Javascript">
    > > <!-- hide this from non JavaScript Browsers
    > > if (window.location != top.location)
    > > {top.location.href=window.location}
    > > // -->
    > > </script>
    > >
    > > But might there be a way to redirect the page to a different page (which in my
    > > case would be a blank page) if it's being framed? Or is that impossible?
    > >

    >
    > not sure if this will do what you want but you can put a meta tag to
    > redirect in the <head> section of the page, this may just reload inside
    > the frame, I aren't sure about that, never use frames can't stand the
    > pesky little creatures.
    >
    > <META http-equiv="refresh" content="3;URL=http://www.foo.com/bar/index.htm">


    That's a handy little tip to knacker the whole web site. Any page
    that has that, regardless of whether it's framed or not, will redirect
    to that page making the site unusable. Anyway, all that does is
    redirect to current window, the other frames will remain.

    --
    Hywel
    Hywel Jenkins, Dec 15, 2003
    #17
  18. DiLu790

    Cameron Guest

    Hywel Jenkins wrote:
    > Cameron <> wrote in message news:<brimor$p73$>...
    >
    >>DiLu790 wrote:
    >>
    >>>Hello, someone's framed one of my pages within their site. Although it may very
    >>>well be a compliment, I don't like it considering the possible repercussions it
    >>>may have on my great rankings at Google.
    >>>
    >>>I dug up the following which DOES work:
    >>>
    >>><script language="Javascript">
    >>><!-- hide this from non JavaScript Browsers
    >>> if (window.location != top.location)
    >>> {top.location.href=window.location}
    >>>// -->
    >>></script>
    >>>
    >>>But might there be a way to redirect the page to a different page (which in my
    >>>case would be a blank page) if it's being framed? Or is that impossible?
    >>>

    >>
    >>not sure if this will do what you want but you can put a meta tag to
    >>redirect in the <head> section of the page, this may just reload inside
    >>the frame, I aren't sure about that, never use frames can't stand the
    >>pesky little creatures.
    >>
    >><META http-equiv="refresh" content="3;URL=http://www.foo.com/bar/index.htm">

    >
    >
    > That's a handy little tip to knacker the whole web site. Any page
    > that has that, regardless of whether it's framed or not, will redirect
    > to that page making the site unusable. Anyway, all that does is
    > redirect to current window, the other frames will remain.
    >


    I said more than once that this may not be what the person was looking
    for, and someone else has already pointed out that this wont work for
    them which is fair enough, however I wont even try in future if sarcasm
    such as "That's a handy little tip to knacker the whole web site" is
    what results, should you have refrained from typing that then I would
    have thought ok that cleared it up, rather than this person is just
    trying to show off.

    ~Cameron
    Cameron, Dec 15, 2003
    #18
  19. DiLu790

    Steve R. Guest

    Cameron wrote in message ...
    > I said more than once that this may not be what the person was looking
    > for.


    I think this is an illustration of what the OP means. If you go to the
    "Links" page of the URL below, and click on a link, the website the link
    points to opens in the current website's frame, which is extremely bad
    practice and looks b*****y awful at 800x600.

    I think the OP is in a similar situation and wishes to write some code/markup
    for his website to escape a similar frame and open in a new window of its own
    accord.

    http://theoddmodsquad.members.easyspace.com/

    Steve :~)
    Steve R., Dec 15, 2003
    #19
  20. Leif K-Brooks wrote:

    > Cameron wrote:
    >> Well the refresh header is mentioned in the HTML 4.0 specification
    >> stating that some user agents support it.

    >
    > The HTML standard has no authority over it, it's an HTTP issue.


    The HTML standard has authority over it if you put it in an http-equiv
    meta tag.

    > HTML doesn't say it's a real standard anyway, just that some browsers
    > support it.


    Recommendation / Standard.

    Po-tay-to / Po-tah-to.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Dec 15, 2003
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bruno Köller
    Replies:
    5
    Views:
    993
  2. chrisdude911
    Replies:
    6
    Views:
    292
    Roy A.
    Jun 3, 2007
  3. Bart Plessers \(artabel\)
    Replies:
    1
    Views:
    126
    Ray at
    Jul 17, 2003
  4. Art
    Replies:
    1
    Views:
    88
    Ray at
    Aug 12, 2004
  5. Aaron Ward
    Replies:
    1
    Views:
    88
    Thomas 'PointedEars' Lahn
    Jun 29, 2004
Loading...

Share This Page