// 使用 window.open 方法打开新页面
function openNewPage(url) {
// url 是要打开的页面链接
window.open(url, '_blank'); // _blank 表示在新标签页中打开
}
// 示例调用
openNewPage('https://www.example.com');
window.open
是 JavaScript 中用于打开新窗口或标签页的方法。_blank
表示在新标签页中打开。你也可以使用其他值,例如 _self
(在当前窗口打开)、_parent
(在父框架中打开)或 _top
(在顶层框架中打开)。上一篇:js 返回上一页面
下一篇:js 在线运行
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站