实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
AخA
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script>
5
function check()
6
{
7
if (window.top!=window.self) 
8
  {
9
  document.write("<p>This window is not the topmost window! Am I in a frame?</p>")
10
  }
11
else
12
  { 
13
  document.write("<p>This window is the topmost window!</p>")
14
  } 
15
}
16
</script>
17
</head>
18
<body>
19
<input type="button" onclick="check()" value="Check window">
20
</body>
21
</html>