window.location.href = "你的URL";//本页URL重定向
window.showModalDialog(URL,[param],[param]);//模态窗口(打开新窗口)
window.showModalessDialog(URL,[param],[param]);//非模态窗口(打开新窗口)
window.open(URL,[param],[param]);//打开新窗口
<script>
window.location="http://www.baidu.com/" //第1种
//window.location.href="http://www.baidu.com/" //第2种
//location="http://www.baidu.com/" //第3种
//location.href="http://www.baidu.com/" //第4种
</script>
location.href='http://www.***.com/'; 在当前页面打开
window.open('http://www.***.com/');在新窗口打开
本文介绍了使用JavaScript进行网页导航及窗口操作的方法,包括URL重定向、打开新窗口、模态对话框等技巧,并展示了不同方式实现页面跳转的示例。
2万+

被折叠的 条评论
为什么被折叠?



