跳出框架

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