加载新文档

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h1>window.location 对象</h1>
  6.  
  7. <input type="button" value="加载新的文档" onclick="newDoc()">
  8.  
  9. <script>
  10. function newDoc() {
  11. window.location.assign("http://www.yousite.com")
  12. }
  13. </script>
  14.  
  15. </body>
  16. </html>