var url = 'www.baidu.com' //跳转1 window.localtion.href = url //跳转2 window.history.pushState(url); window.history.replaceState(url); //跳转3 window.open(url,"_blank"); //跳转4 var a = document.createElement("a"); a.setAttribute("href", "www.baidu.com"); a.setAttribute("target", "_blank"); a.click();
链接跳转的4 种方式问题
最新推荐文章于 2024-04-24 14:53:02 发布