How can create an iframe breaking script which shows a alert box if the page is loaded in an iframe and when the alert box is clicked, it should br开发者_JAVA技巧eak the frame and the script should be seen.
if (top != window) {
alert("please don't load my in a frame, thx.");
top.location.href = location.href;
}
might do the trick.
精彩评论