For anyone who is interested in blocking their site off – a concern is that an iframe can be used to include pages on your website into external sites. So to prevent people hotlinking your site’s webpages through iFrames simply include this script at the top of your pages.

Also see related posts:
JQUERY CHECK IF WINDOW IS IN IFRAME
JQUERY RELOAD AN IFRAME
GETTING THE SRC OF AN INJECTED IFRAME WITH JQUERY

Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.


  • http://twitter.com/100r0bh saurabh mahajan

    cool

Learn JavaScript for free!
Free course: Introduction to JavaScript

Yours when you take up a free 14-day SitePoint Premium trial.