Busting out of Frames?

Top Hat

Free Member
Mar 3, 2005
2,183
172
Airstrip One
A while ago I added some code to our pages to break out of frames, basically other sites were loading our site into a frame on their site.

Code:
<SCRIPT language="JavaScript"><!--
if &#40;parent.frames.length > 0&#41; &#123;
parent.location.href = location.href;
&#125;
// --></SCRIPT>

The code works well in that it breaks out of frames, but it breaks the back button as well (only if it was framed)

Should I dump this code?


Supplementary Q

Code:
<meta name="MSSmartTagsPreventParsing" content="TRUE">

Can I get rid of this now too?
 
Second point, yes. Technically (no point in removing it) but you also don't need

Code:
<META NAME="ROBOTS" CONTENT="INDEX,FOLLOW">

As this is a default.
 
Upvote 0
Why are you worried about the back button if it will only take the user back to the site that cheekily framed your content?

I take it it doesn't effect the use of the back button for regular visitors?
 
Upvote 0
Duane - It's bad karma to break the back button, man!

Mac - Yes, it is default, but it gives you that warm, fuzzy feeling inside knowing that robots know exactly what to do when they visit your pages.
 
Upvote 0

Latest Articles