根据来源网址跳转到不同页面:IS代码示例
<script>
// 获取来源网址
var referrer = document.referrer;
// 判断来源是否是baidu.com
if (referrer.includes('baidu.com')) {
// 如果是baidu.com来源,跳转到a.baidu.com
window.location.href = 'https://a.baidu.com';
} else {
// 如果不是baidu.com来源,跳转到V.baidu.com
window.location.href = 'https://V.baidu.com';
}
</script>
<p>请注意,上述代码需要放在需要跳转的页面的代码中,当页面加载时,会根据来源进行相应的跳转。</p>
原文地址: https://www.cveoy.top/t/topic/p8hb 著作权归作者所有。请勿转载和采集!