检测用户是否使用了后退按钮

Tom*_*Tom 8 javascript back-button

我的网页在加载页面时运行javascript函数.但是,如果用户使用后退按钮返回此页面,我不希望该功能运行.如何使用javascript来防止这种情况?

$(document).ready(function(){
  // Do not run this function if the user has arrived here using the back button  
  RefreshThePage();
});
Run Code Online (Sandbox Code Playgroud)

mat*_*pol 4

我本以为使用 cookie 是最简单的方法