Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Adobe Dreamweaver

This chapter is from the book

HELP, I'VE BEEN FRAMED, AGAIN!

Framed against your will? How do you keep your pages from being frame-napped and placed in someone else's frameset? Here's the JavaScript to place in pages you want to keep frameless:

<script language="JavaScript">
if (self.parent.frames.length!=0){
self.parent.location.replace(document.location.href)
}
</script>

If you want to keep your hand-coding to a minimum, another solution is to add the Thierry Koblentz Break Out Of Frames extension (available from the Dreamweaver Exchange) to your page. Not adverse to a minimum of handiwork? Turn the preceding code into a snippet and apply at your leisure.

  • + Share This
  • 🔖 Save To Your Account