[英]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.