Forum Moderators: open
<script TYPE="text/javascript">
if(top.location!= document.location)
top.location = document.location;
</script>
have I screwed up the code or will I see these problems because I'm using this?
Thanks
<added> I'm using it in the head section </added>
I had a similar problem, especially when framed by Lycos's "Fast Forward" feature. The frame-escape would often leave "broken" html fragments on the page.
I fixed it by moving the frame buster to the bottom of the page. Since the page is already (usually) cached, it the reload isn't usually disuptive.
Here's the code I was using:
<script language="JavaScript1.1" type="text/JavaScript"> <!--
if (parent.frames.length > 0) top.location.replace(document.location); // Escape from frame, but retain one-click "Back". -->
</script>
</body>
</html>
I'd love to hear some better suggestions - I got it working and forgot about it, but it's rather inelegant.
Jim
What I meant was that moving my code to the bottom of the page where it will force a reload (but usually from the browser cache) was inelegant - I certainly meant no disrespect to your code. Moving the frame-buster fixed the problem I was seeing, but forced the entire page to be reloaded - so I considered it a "band-aid" fix.
Earnestly awaiting more opinions...
Jim