二维码防伪系统

新闻中心

各种活动实时推动

在javascript中打开新窗口的设置方法

发布时间:2024-11-27 点击次数:217

最近 在做一个项目,需要在Javascript打开新窗口,使用location.href和location.replace都只能在当前页打开,使用open又容易被链接,最后想了一个变通的方法。

<script type="text/javascript"   language="JavaScript">    function   GoUrl()    {        document.all.netbee.href=";     document.all.netbee.target="_blank";     document.all.netbee.click();  

return false;  }</script>

 

然后在html文件中加一个

<a   id="netbee"></a>

copy © 2025 星澜网络 All Rights Reserved

备案号:鲁ICP备2023015769号