I'm提交表單在新標籤頁中:如何重定向舊標籤後,我提出一個新的標籤
<form action="xxx.php" target="_blank" method="post">
但舊標籤停留在形式和我倒是想發送提交後到另一個頁面。
謝謝!
I'm提交表單在新標籤頁中:如何重定向舊標籤後,我提出一個新的標籤
<form action="xxx.php" target="_blank" method="post">
但舊標籤停留在形式和我倒是想發送提交後到另一個頁面。
謝謝!
兩個選項:
1)只需卸下target="_blank"
和重定向的形式在同一頁面。
2)使用jQuery執行函數形式提交後:
$('#myForm').submit(function(e) {
// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");
});
製造它..
通過GET
function load(){
<?php
$url = "XXX.php?VAR=".$Z;
echo "window.open('$url');".PHP_EOL;
echo "window.location.href = 'YYY.php';";
?>
}
好極了!如果我的評論幫助了你,請注意它:) –
您還可以使用標頭('位置! url.php'); – HebleV
這個解決方案的另一篇文章,檢查:[(https://stackoverflow.com/questions/8773622/close-window-aft呃重定向](https://stackoverflow.com/questions/8773622/close-window -aft er-redirect) –
不是我所需要的,謝謝 – Logic