Force page into MY frameset, not linker's

liunx

Guest
I have a problem when other sites link to one of my content pages that is designed to be displayed in a content frame, and they cause the page to be displayed in THEIR frameset. <br />
<br />
I need a code to break out of their frameset, and open the page in my frameset.<br />
<br />
I'm able to breakout ok, but the code I'm using to place page in my frameset is a refresh code, and this also invokes the breakout code each time, resulting in a never ending cycle.<br />
<br />
Thanks!<br />
Rick Knock<br />
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --><!--content-->Put this in your page:<br />
<br />
<body onload="checkHost()"><br />
<br />
<script language="JavaScript"><br />
function checkHost() {<br />
if (self.location.hostname != top.location.hostname) <br />
top.location.href = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"http://www.yoursite/frameset.html"<br />
}<br />
</script><!--content-->Thanks for your reply. But...<br />
<br />
I tried inserting the code into the body and into the header. Both produced error on page. I omitted "body" at the beginning of the code, and it didn't produce error, but also didn't seem to do anything.<br />
<br />
The pages I'm using to test this are:<br />
<br />
I'm linking to <!-- w --><a class="postlink" href="http://www.daydawn.net/meet/sonese/sonese001.html">www.daydawn.net/meet/sonese/sonese001.html</a><!-- w --><br />
I'm linking from: <!-- w --><a class="postlink" href="http://www.dork.com/kalinza">www.dork.com/kalinza</a><!-- w --> (go to "links" by scrolling down in upper right hand frame, then click on "Sonese" in links.)<br />
<br />
Thanks for any further help!<!--content-->OK, the 'body' is the body tag on your page. Try this instead:<br />
<br />
<br />
<script language="JavaScript"><br />
function checkHost() {<br />
if (self.location.hostname != top.location.hostname) <br />
top.location.href = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"http://www.yoursite/frameset.html"<br />
}<br />
<br />
window.onload = checkHost;<br />
<br />
</script><br />
<br />
<br />
And if you get an error, please note what it says.<br />
If you have any more trouble, please send a link to the actual page where you have inserted the script.<!--content-->Thanks again for trying to help. I tried putting the code in the header and in the body, and both produced errors on page.<br />
<br />
Would you be willing to look at the source? It's at <!-- m --><a class="postlink" href="http://www.daydawn.net/meet/sonese/sonese001.html">http://www.daydawn.net/meet/sonese/sonese001.html</a><!-- m --><br />
<br />
Thanks! I really appreciate your help!<br />
<br />
Rick<!--content-->The code it's gagging on is this:<br />
<br />
an=navigator.appName;d=document;function<br />
pr(){d.write("<img src=http://www.htmlforums.com/archive/index.php/\"http://w0.extreme-dm.com",<br />
"/0.gif?tag=sonese&j=y&srw="+srw+"&srb="+srb+"&",<br />
"rs="+r+"&l="+escape(parent.document.referrer)+"\" height=1 ",<br />
"width=1>");<br />
<br />
<br />
It's some kind of web agent from the look of things, if you didn't put it there then your ISP is putting it there to keep track of things.<!--content-->Thanks Jon.<br />
<br />
The code you referred to is a tracker. I appreciate all your help!<br />
<br />
God Bless!<br />
<br />
Rick<!--content-->
 
Back
Top