1

メタ リフレッシュ ラインをラインより上にする必要はあります</head>か? 私の場合、ページが自動更新されるまでの秒数を決定するためにいくつかの変数を解析する必要があるため、できません。これはすべてページの真ん中で行われ、このタグも真ん中に配置します。私の成功率はかなり良かったのですが、まったく更新されないこともありました。

100% の確率で成功率を保証する、他に使用できるリフレッシュ コードはありますか?

ここで使用しているタグは次のとおりです。

<meta http-equiv="refresh" content="<?=$now['rsecs'];?>" url="&session<?=rand(1,999999999999)?>">
4

2 に答える 2

1

構文が間違っています:

<meta http-equiv="refresh" content="<?php echo $now['rsecs'];?>;URL='&session=<?php echo rand(1,999999999999);?>'">

&session を URL パスに追加するだけで正しい場所に移動できるかどうかはわかりません。おそらく完全なURLを含めますか?

URL='http://www.your-site.com/page.html?othervars=othervals&session=<?php echo rand(1,999999999999);?>
于 2012-08-01T16:13:07.267 に答える
0

この URL を参照してください:-

http://davidwalsh.name/automatically-refresh-page-javascript-meta-tags

http://www.techtricky.com/how-to-refresh-page-or-part-of-the-page-automatically/

これを試して

JavaScript メソッド

var timer = null;
function auto_reload()
{
  window.location = 'http://domain.com/page.php';
}

 <body onload="timer = setTimeout('auto_reload()',10000);">

また

META タグ方式

以下は、30 秒ごとにページを更新します。

<head>
<meta http-equiv="refresh" content="30" />
</head>

また

<meta http-equiv="refresh" content="0;http://www.example.com" />

または

<meta http-equiv="refresh" content="0;URL=http://www.example.com" />

または

<meta http-equiv="refresh" content="30;URL=http://intranet/page.asp?x=123" />
于 2012-08-01T16:12:16.760 に答える