编辑下面的代码:【加编码】
<html> <head> <script> function check() { if (window.top!=window.self) { document.write("<p>This window is not the topmost window! Am I in a frame?</p>") } else { document.write("<p>This window is the topmost window!</p>") } } </script> </head> <body> <input type="button" onclick="check()" value="Check window"> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂