JavaScript 提供了多种进行页面跳转的方法:直接修改 URL:window.location.href。替换历史记录:window.location.replace()。打开新窗口或标签页:window.open()。通过 DOM 修改 URL:document.location.href。通过 DOM 替换 URL:document.location.replace()。

如何使用 JavaScript 进行页面跳转
JavaScript 提供了多种方式来进行页面跳转,包括:
1. window.location.href
语法:window.location.href = "new_url"
此方法直接修改当前页面的 URL,从而导致页面跳转。
2. window.location.replace()
语法:window.location.replace("new_url")
此方法替换当前页面的历史记录,从而导致页面跳转。与 window.location.href 不同的是,它不会在浏览器历史记录中留下当前页面。
3. window.open()
语法:window.open("new_url")
BIWEB 门户版几经周折,最终与大家见面了。BIWEB门户版建立在ArthurXF5.8.3底层上,有了更加强大的功能。 BIWEB WMS v5.8.3 (2010.1.29) 更新功能如下: 1.修正了底层getInfo方法中的调用参数,做到可以根据字段进行调用。 2.修正了栏目安装和卸载后,跳转链接的错误。 3.修正所有栏目分类系统,提交信息页面错误。 4.新增后台删除信息后仍停留原分
此方法打开一个新窗口或标签页并加载指定 URL。
4. document.location.href
语法:document.location.href = "new_url"
此方法与 window.location.href 类似,但它通过 DOM 而不是 window 对象访问页面 URL。
5. document.location.replace()
语法:document.location.replace("new_url")
此方法与 window.location.replace() 类似,但它通过 DOM 而不是 window 对象替换页面 URL。
示例:
// 使用 window.location.href 跳转到新页面
window.location.href = "https://www.example.com";
// 使用 window.location.replace() 跳转到新页面
window.location.replace("https://www.example.com");
// 使用 window.open() 打开新窗口
window.open("https://www.example.com");
// 使用 document.location.href 跳转到新页面
document.location.href = "https://www.example.com";
// 使用 document.location.replace() 替换当前页面 URL
document.location.replace("https://www.example.com");









