本代码片段可以防止网站页面被iframe嵌套。
(function(window,document){ if(top != window){ top.location = location.href; } document.uniqueID != document.uniqueID && !!location.hash && (location.hash = location.hash); window.focus(); })(this,document);
关于uniqueID 可以参考:http://zhangyaochun.iteye.com/blog/1673533