跳出框架

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function breakout()
  5. {
  6. if (window.top!=window.self)
  7. {
  8. window.top.location="/example/hdom/tryjs_breakout.htm"
  9. }
  10. }
  11. </script>
  12. </head>
  13. <body>
  14.  
  15. <input type="button" onclick="breakout()" value="跳出框架!">
  16.  
  17. </body>
  18. </html>