JS历理 根据来源跳转指定页面

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="0; url=https://www.cnblogs.com/onestopweb">
<title>HTML直接跳转指定页面</title>
</head>
<body>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
//if (window.location.href.includes('123'))
if (document.referrer === '') {
document.writeln("<meta http-equiv=\'refresh\' content=\'0; url=https://www.cnblogs.com/onestopweb'\'>");
self.location.href='https://www.cnblogs.com/onestopweb';
} else {
document.writeln("<meta http-equiv=\'refresh\' content=\'0; url=https://www.cnblogs.com/onestopweb/p/18237996'\'>");
self.location.href='https://www.cnblogs.com/onestopweb/p/18237996';
}
</script>
<title>JS 根据来源跳转指定页面</title>
</head>
<body>
</body>
</html>

效果图:

posted @ 2024-06-20 15:25  onestopweb  阅读(21)  评论(0)    收藏  举报