跳至侧栏

禁止和允许被iframe

1.防止被iframe
if (window != window.top)
{ window.top.location = location; }

2.允许被信任的网站iframe
var framebustTimer;
var timeout = 3000; // 3 second framebust timeout

if (window != window.top)
{
framebustTimer = setTimeout(
function() { window.top.location = location; }, timeout);
}

posted @ 2012-12-21 16:40  JiayangShen  阅读(1271)  评论(0编辑  收藏  举报
Top
推荐
收藏
关注
评论