<div class="codetitle"> <span><a style="CURSOR: pointer" data="901" class="copybut" id="copybut901" onclick="doCopy('code901')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code901"> <br> <br> <br><title>测试</title> <br><script language="javascript" type="text/javascript"> <br><br>function getStyle() { <br><br>if (window.top == window.self) { <br><br>document.getElementById("top").style.display = 'block'; <br><br>} else { <br><br>document.getElementById("top").style.display = 'none'; <br><br><BR>} <br><br>} <BR></script> <br><br> <br> <br><form id="form1" runat="server"> <br><div id="top"> <br>在框架中不显示,正常访问显示 <br> </div> <br> </form> <br> <br> <br> </div> <br>当当前页面正常访问时显示div top <br><br>当当前页面在iframe中时页面不显示 div top