0
html/phpページは別のhtml/phpページにリダイレクトする必要があります。その後、元の状態に戻す必要があります。特定の時間にページをリダイレクト
<meta http-equiv="refresh" content="1;URL='TV_moem_ruki.php'" />
ページが読み込まれた直後にリダイレクトされます。
私は、ある時点でページを更新し、以下のスクリプトにこの
header("Location: TV_moem_ruki.php") ;
を組み合わせて試してみたが、それは動作しません。
<script>
refreshAt(13,10,0); //Will refresh the page at 11:05am
</script>
<script>
function refreshAt(hours, minutes, seconds) {
var now = new Date();
var then = new Date();
if(now.getHours() > hours ||
(now.getHours() == hours && now.getMinutes() > minutes) ||
now.getHours() == hours && now.getMinutes() == minutes && now.getSeconds() >= seconds) {
then.setDate(now.getDate() + 1);
}
then.setHours(hours);
then.setMinutes(minutes);
then.setSeconds(seconds);
var timeout = (then.getTime() - now.getTime());
setTimeout(function() { window.location.reload(true); }, timeout);
header("Location: TV_moem_ruki.php") ;
}
</script>
はheader()には必要ありませんphp function in javascript。 setTimeout関数の 'window.location.href =" TV_moem_ruki.php ";'を使用してください –
ありがとうございます。これは働いた。 – user72160