JS如果用户首次访问网站重定向到指定页面
本文最后更新于 1524 天前,其中的信息可能已经有所发展或是发生改变。

熟悉我的朋友可能知道,我有一个AO3的镜像界面。为了实现多节点,我将我的镜像站分为了1.ao3-cn.top和2.ao3-cn.top。但这样会使我主页,也就是@解析的用户减少,用户大多数会用节点的链接进行分享。为了解决这样的问题,我们可以用cookie和javascript来实现让首次访问的用户跳转到主页。

原理很简单,大概就是检测用户的cookie,如果有就不跳转,如果没有跳转到首页。

// Check cookie is live.
function checkCookie(){
    var Status=getCookie("Status");
    if (Status!=""){
        return 1;
    }
    else {
        return 0;
    }
}

function getCookie(cname){
    var name = cname + "=";
    var ca = document.cookie.split(';');

评论

  1. 4 天前
    2026-11-22 18:55:01

    [2210]ff777 Login PH – Legit Online Slots at GCash Cashout,Mag-ff777 login ph na para sa legit online casino Philippines. Madaling ff777 download APK at mabilis na online slots GCash cashout. Sali na at maglaro! visit: ff777

  2. 1 周前
    2026-11-17 23:01:32

    [1689]77bd লগইন ও অ্যাপ ডাউনলোড | বিকাশ ক্যাসিনো ডিপোজিট,77bd লগইন করে লাইভ ক্যাসিনো বোনাস অফার পান এবং বিকাশ দিয়ে ক্যাসিনো ডিপোজিট করুন। অনলাইন স্লট গেম ট্রিকস শিখতে আজই অ্যাপটি ডাউনলোড করুন। visit: 77bd

  3. 2 周前
    2026-11-11 9:34:41

    [8916]okclubmx Login Oficial | Mejores Slots y Depósitos OXXO en México,Accede a okclubmx para disfrutar de las mejores slots. Descarga la apk oficial y recarga tu cuenta fácilmente vía OXXO. Regístrate ahora y empieza a jugar. visit: okclubmx

  4. 3 周前
    2026-11-07 18:26:47

    [1806]7000bat লগইন ও অ্যাপ ডাউনলোড – সেরা অনলাইন স্লট গেম,7000bat login করুন এবং অ্যাপ ডাউনলোড করে উপভোগ করুন সেরা অনলাইন স্লট গেম। বিকাশ দিয়ে ক্যাসিনো ডিপোজিট করে আজই খেলা শুরু করুন। visit: 7000bat

  5. 4 周前
    2026-11-01 10:49:38

    Really impressed with the variety of games here. Everything loads quickly and I haven’t had any lag during my sessions. Definitely check out zo88vip if you want a top-tier experience.

  6. 4 周前
    2026-10-29 12:39:30

    [658]Tayabet Login at Register | Legit Online Slots via GCash,Gamitin ang tayabet login app para sa mabilis na access. Mag-register account na at subukan ang legit online slots gcash. Maglaro na ngayon! visit: tayabet

  7. 1 月前
    2026-10-25 8:38:44

    Finally found a platform that actually works without lagging. The interface is very user friendly and the bonuses are legit. pk365apkpk

  8. 1 月前
    2026-10-22 1:15:53

    Just tried it out and I am loving the vibe. The setup was a breeze and the gameplay is addictive. bdjoya9app is definitely my new favorite.

  9. 1 月前
    2026-10-16 23:39:41

    Finally found a site that doesn’t crash every five minutes. The interface is super user-friendly and the payouts feel fair. Highly recommend giving 65jililogin a try if you are into online gaming.

  10. 1 月前
    2026-10-16 6:36:28

    [7453]36jl98 Login at Download APK – Online Slots via GCash,Mag-login sa 36jl98 para sa online slots gcash deposit. Alamin din kung paano maglaro ng baccarat at i-download ang APK para sa mabilis na access. Sali na! visit: 36jl98

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇