Web Design, 3d & More - Aaron Newton 

Prevent Client-Side iframe Hotlinking with Javascript

I thought frames went out of style a decade ago but apparently everyone feels the need to duplicate the Digg Bar. I don’t trust these framed services so I choose to use a javascript snippet that prevents my site from being in someone else’s frame.

The Javascript

if (top.location != self.location) {
        top.location = self.location;
}

This comes in very handy if you want to prevent people from hotlinking your content with iframes.

Posted by Aaron Newton 

Comments (0)

Leave a comment...



Contact Us   |