console.log(document.referrer) if(document.referrer=="http://127.0.0.1:8020/qianduan/demo/a-b-c/a.html"){ console.log(1) $('p').css('color','red'); }