我已经坚持了一个多小时:
if((document.referrer===undefined)){
if(url_window_location=='http://www.lhttp://livecas.com/sandbox/andbox/'){
event_google_analytics_referrer=document.referrer.toString();
log("DOCUMENT REFERRER: cookie is set user_details: "+document.referrer);
eraseCookie('user_details');
setCookie('user_details',document.referrer,365);
}
if(url_window_location=='hhttp://livecas.com/sandbox/e')
{
eraseCookie('user_details');
setCookie('landing_page_ref',"FBLND1",365);
// log("Cookie is set");
}
}
else{
if(url_window_location=='http://livecas.com/sandbox/'){
eraseCookie('user_details');
setCookie('user_details',"Direct",365);
log("Direct cookie is set");
event_google_analytics_referrer="Direct";
}
}
如果 document.referrer 已设置/存在或其他,我希望它在 if 条件下执行块,如果不是,我希望它在 else 条件下。现在无论如何它都会进入其他条件