Way to Redirect Framed Page???

D

DiLu790

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?
 
C

Cameron

DiLu790 said:
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
 
S

Sid Ismail

On 14 Dec 2003 21:51:37 GMT, (e-mail address removed) (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
 
A

Andrew Graham

DiLu790 said:
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
 
S

Sid Ismail

: 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
 
C

Cameron

Sid said:
: 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
 
T

Toby A Inkster

Cameron said:
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.
 
D

DiLu790

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.
 
S

Sid Ismail

On 14 Dec 2003 23:30:39 GMT, (e-mail address removed) (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
 
C

Cameron

Toby said:
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.

~Cameron
 
A

A Hess

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*
 
L

Leif K-Brooks

Cameron said:
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.
 
L

Leif K-Brooks

Cameron said:
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.
 
C

Cameron

Leif said:
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
 
H

Hywel Jenkins

Cameron said:
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.
 
C

Cameron

Hywel said:
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
 
S

Steve R.

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 :~)
 
T

Toby A Inkster

Leif said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top