首页 > 其他 > 详细

assign() 方法

时间:2016-12-07 01:37:09      阅读:150      评论:0      收藏:0      [点我收藏+]

assign() 方法可加载一个新的文档。

语法

location.assign(URL)

 1 <html>
 2 <head>
 3 <script type="text/javascript">
 4 function newDoc()
 5   {
 6   window.location.assign("http://www.baidu.com")
 7   }
 8 </script>
 9 </head>
10 <body>
11 
12 <input type="button" value="Load new document" onclick="newDoc()" />
13 
14 </body>
15 </html>

 

assign() 方法

原文:http://www.cnblogs.com/zhn0823/p/6139559.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!