开发者

Iframe breaking script

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜