经常有人把我网站盗用到框架内占为已有,有什么办法不在框架内打开而是打开新窗口?
<Script LANGUAGE="JavaScript">
if(self!=top){top.location=self.location;}
</script>
以上代码效果不好
參考答案:呵呵~
搞定了:
<script>
if(top.window.frames.length>0){
var frm = top.document.createElement("form");
top.document.body.insertBefore(frm);
frm.method = "post";
frm.action = self.location;
frm.submit();
}
</script>
=======================================
是哪种情况下被框架了?
最好给个实例,好寻求应对措施。
=======================================
可以试试下面的两种方法:
if(top.window.frames.length>0){top.location.replace(self.location)};
if(window!=top)top.location=location;