script for iframe redirect needed

G

Guest

Hi,

is there a java script or something similar that will make it that if
someone ends up on an iframe page (the frame itself) he will always be
redirected to the full page where the iframe is embedded instead of getting
just the iframe content?

Thank you!
 
T

Trevor L.

Hi Mstar,

I use:
<body onload="detect();"> in every frame page

where detect is a JS function in a file which is linked into every frame
page by the code:
<script type="text/javascript" src="scripts/external.js"> </script> in the
<head> section

In external.js:
function detect()
{ var framesetpage = "index.html"
if (parent.location.href == window.location.href)
parent.location.href = framesetpage}

and where "index.html" is the full page where the frame is embedded

I use frames not iframes but the theory should be the same.

--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
Hi,

is there a java script or something similar that will make it that if
someone ends up on an iframe page (the frame itself) he will always be
redirected to the full page where the iframe is embedded instead of
getting just the iframe content?

Thank you!


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 

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

Top