简单明了的例子拿走!

if (document.referrer==""){
window.location.href = "/app/index.php?i=5&c=entry&do=cover&m=ruyi_mobile&op=success";
}else{
window.history.go( - 1);
return;
}

备注:只能用document.referrer是否为空来判断!history.length判断的是你访问了几个页面,并不是当前是否有上一页!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-12-22
  • 2022-02-14
  • 2021-07-12
  • 2021-11-14
猜你喜欢
  • 2021-09-26
  • 2022-02-02
  • 2021-12-27
  • 2022-01-24
  • 2021-05-29
  • 2022-03-08
  • 2021-12-19
相关资源
相似解决方案