防止网页被嵌入框架(Frame)

tech2024-01-05  69

防止网页被嵌入框架(Frame)

<script type="text/javascript">   try{    top.location.hostname;    if (top.location.hostname != window.location.hostname) {      top.location.href =window.location.href;    } } catch(e){    top.location.href = window.location.href; } </script>

链接: http://www.ruanyifeng.com/blog/2010/08/anti-frameset_javascript_codes_continued.html.

最新回复(0)