JavaScriptアラートを表示した後、別のページに移動するにはどうしたらいいですか?ありがとうございました:D 次のコードは別のページに移動しますか?JavaScriptアラートを表示した後に別のページに移動する方法
if(isset ($_POST['reply'])){
echo "<script>alert('Login to continue.')</script>";
}
JavaScriptアラートを表示した後、別のページに移動するにはどうしたらいいですか?ありがとうございました:D 次のコードは別のページに移動しますか?JavaScriptアラートを表示した後に別のページに移動する方法
if(isset ($_POST['reply'])){
echo "<script>alert('Login to continue.')</script>";
}
あなたは道の下javascriptのを使用することができます。
window.location = "http://www.domain.com";
また、あなたは、PHPコードを試すことができます。
header('Location: targetPage.php');
は、あなたがこの
echo "<script>alert('Update Not Successfully');document.location='pagename.php'</script>";
を探しているホープ
エコーの開始点と終了点にスクリプトを書き込むことを忘れないでください。
ありがとうございました。出来た! :D私は学校で私のブログ、私のブログでほぼ完了です。 :) –
ようこそ、素晴らしい。 –
JavaScript confirm
とwindow.location
の両方を使用する必要があります。
var r = confirm("Login to continue.");
if (r == true)
{
window.location = "http://www.domain.com/agreed.html";
}
else
{
window.location = "http://www.domain.com/cancelled.html";
}
ヘッダー( '場所:another_page.php'); –
http://stackoverflow.com/questions/4744751/how-do-i-redirect-with-javascript –
@DharmParmarページに印刷した後にヘッダーを再発行することはできません。 – Terry