【发布时间】:2014-02-05 17:47:06
【问题描述】:
我需要隐藏基于 wordpress 的网站的标题,以防网站加载到 iFrame 中。 我应该用javascript、函数还是css来做?我该怎么做? 我找到了这个
<script type="text/javascript">
var isInIFrame = (window.location != window.parent.location);
if(isInIFrame==true){
alert("It's in an iFrame");
document.getElementById('header').style.display = "none";
}
else {
alert("It's NOT in an iFrame");
}
</script>
但我不知道把它放在哪里(而且我也不知道它是否可以工作)。 希望有人能帮帮我,谢谢!
【问题讨论】: