网站被被黑强制注入JS,嵌入iframe弹窗广告的解决方法:
1.使用ssl证书加密【推荐,之后的方法治标不治本】
2.meta禁用iframe
1 |
<meta http-equiv="X-Frame-Options" content="DENY"> |
3.js禁用iframe【列举一个】
1 2 3 |
<script type="text/javascript"> if(top.location!=self.location)top.location=self.location; </script> |
4.css让iframe显示为空白
1 2 3 |
<style type="text/css"> iframe{ v:expression(this.src='about:blank',this.outerHTML='');} </style> |