Take away simple and clear examples!
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;
}
Remarks: You can only judge whether document.referrer is empty! history.length judges that you have visited several pages, not whether there is currently a previous page!