一個業務中可能會用到,跳轉到另個頁面后, 又后退回之前的頁面,之前的頁面上有個判斷提示一定會出
網上搬了下代碼
console.log("js獲取當前域名"+window.location.host+"或者"+document.domain+"<br>");
console.log("js獲取當前url"+window.location.href+"<br>");
console.log("js獲取上(前)一頁url"+document.referrer);
