0

重複の可能性:
History.Back with refresh

に割り当てた入力ボタンがありますonclick="history.back()"

これを使用する方法はありますが、前のページを強制的に更新しますか?FFとIE8で動作させたい

4

1 に答える 1

0

Depending on what exactly you need, here is a fix which needs some more preparation at first, but should work:

  1. Place an invisible element with a (serverside created) timestamp in your document.
  2. Place an eventlistenener which checks the timestamp and reloads the page if it is too old.

Now when you navigate back to this site, either via your button or the browser's back button, the onload handler will fire, check the date and reload the page if necessary.

client side pseudo code:

document.body.addEventListener("load",function(){
    // compare timestamp stored in element with current time and if it is too old,
    // reload page e.g. via document.location.reload()
   var d1 = document.querySelector("#timestamp").innerHTML;
   var d2 = Date.now;
   if (d2-d1 > 10000 ) document.location.reload();
});
于 2013-01-25T10:16:43.190 に答える