开发者

Iframe breaking script

开发者 https://www.devze.com 2023-04-11 20:53 出处:网络
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

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

精彩评论

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

关注公众号