location.assign() 方法加载新的文档
<html> <head> <script> function newDoc() { window.location.assign(http://www.baidu.com.cn) } </script> </head> <body> <input type="button" value="加载新文档" onclick="newDoc()"> </body> </html>
<html> <head> <script> function newDoc() { window.location.assign(http://www.baidu.com.cn) } </script> </head> <body> <input type="button" value="加载新文档" onclick="newDoc()"> </body> </html>