繁体   English   中英

重定向到新页面

[英]Redirecting to a new page

我定义了一个要在新窗口中打开页面的函数。 该函数具有以下代码:

echo"<script>window.location.href='http://localhost/paymentsystem/views/payment.php?id=".$id."'</script>" ;  

现在,它在同一窗口上打开页面。

我想知道如何在新标签页上打开此页面?

问候,

潘卡

尝试:

window.open("yourSite.html","plain","width=470,height=452");

而不是window.location.href

如果您想使用html打开新窗口,则必须在下面使用

       <a href="example.html" target="_blank">link text</a> 

并在javascript中实现它,您必须尝试以下

echo“ window.open(' http://localhost/paymentsystem/views/payment.php?id = ”。$ id。“')”;

我希望这能帮到您..

感谢名单。

您也可以使用

<a href="http://example.com" target="_blank">Click here</a>

对于更简单的解决方案,尽管我相信很快会弃用'target'属性。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM