PageSourceSearch

https://www.chemicalbook.com/control/goindia.js

js chemicalbook.com collected 2026-10-02 04:13:45 UTC 4,388 bytes, 113 lines download raw bytes

1var styleLoginTip_India = `<style type="text/css" id="style_goindia">
2.inbox{width:400px;height:200px;padding:30px; border-radius:10px; background:#fff;box-shadow:0 0 10px #333; position:fixed;top:50%;left:50%;margin-top:-200px;margin-left:-200px;}
3.intitle{font-size:20px; text-align:center; letter-spacing:10px; font-weight:bold}
4.inletter{font-size:15px;color:#333;margin:20px 0; line-height:24px;}
5.inbut{ text-align:center}
6.inbut a{padding:6px 24px;border:1px solid #888; color:#333;border-radius:5px;margin:0 10px; text-decoration:none; display:inline-block}
7a.in3{ background:#ff7300;border-color:#ff7300; color:#fff;}
8</style>`
9var goIndiaTipHtml = `<div class="inbox" id="dv_goindia">
10<div class="intitle">友情提示</div>
11<div class="inletter">
12您即将离开ChemicalBook平台,访问第三方网站。<br>
13该网站内容与政策由对方独立管理,建议查阅并充分了解对方网站的相关条款和政策。<br>
14继续访问请点击下方链接,感谢您的理解!
15</div>
16<div class="inbut">
17    <a href="javascript:void(0)" class="in2" id="btn_goindia_not">留在本站</a><a href="https://www.chemicalbook.in/" target="_blank" class="in3" id="btn_goindia">继续访问</a>
18</div>
19</div>`;
20function GetCookie(name) {
21    var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
22    if (arr = document.cookie.match(reg))
23        return unescape(arr[2]);
24    else
25        return null;
26}
27
28var dayCharString = "trfguijbpzaxolyndhvkcmweqs";
29var monCharString = "dfxeojzctsirhlbqyknpgmvuwadfxeojzctsirhlbqyknpgmvuwa";
30function getCurDateCharString() {
31    var dayOfYear = getDayOfYear(new Date()) - 1;
32    var curmon = Math.floor(dayOfYear / 26);
33    return monCharString[curmon + (dayOfYear % 26)] + dayCharString[dayOfYear % 26];
34}
35function getDayOfYear(date) {
36    const start = new Date(date.getFullYear(), 0, 0);
37    const diff = date - start;
38    const oneDay = 1000 * 60 * 60 * 24;
39    return Math.floor(diff / oneDay);
40}
41function showIndiaTip(e, styleLoginTip_India, goIndiaTipHtml, href) {
42    if ($("#style_goindia").length <= 0) {
43        $("head").append(styleLoginTip_India);
44    }
45    if ($("#dv_goindia").length <= 0) {
46        $("body").append(goIndiaTipHtml);
47        $(".closew").click(function () {
48            $("#dv_goindia").hide();
49        });
50        $("#dv_goindia").find("#btn_goindia,#btn_goindia_not").click(function () {
51
52            $("#dv_goindia").hide();
53        });
54    }
55    $("#dv_goindia").attr("data-href", href);
56    $("#dv_goindia").show();
57    $("#dv_goindia").find("[name='btn_goindia']").attr("href", href)
58    $("#dv_goindia").find("[name='btn_goindia_not']").attr("href", href)
59    //$("#dv_goindia").find("[name='userName']").html(userName);
60    if (!e) {
61        e = window.event;
62    }
63    if (e) {
64        e.preventDefault ? e.preventDefault() : e.returnValue = false;
65    }
66}
67$(function () {
68    $("[data-go='india']").click(function (e) {
69        var href = $(this).attr("href");
70        var isClick = false;
71        if (!href) {
72            href = $(this).attr("data-href");
73            isClick = true;
74        }
75
76
77        var userName = GetCookie("userName");
78        var sn = GetCookie("_ancsi_") || GetCookie("__ancsi_");
79        var st = GetCookie("_ancsi_t_") || GetCookie("__ancsi_t_");
80        if (userName) {
81            var isAgree = false;
82            $.ajax({
83                url: "/Handler/GetAgreeLoginHandler.ashx",
84                type: "get",
85                dataType: "json",
86                async: false,
87                success: function (json) {
88                    if (json.code == 0) {
89                        isAgree = json.dataObj.agree;
90                        sn = json.dataObj.sn;
91                        st = json.dataObj.st;
92                    }
93                },
94                error: function () {
95
96                }
97            })
98
99            if (!isAgree) {
100                showIndiaTip(e, styleLoginTip_India, goIndiaTipHtml, href);
101            } else {
102                if (isClick) {
103                    window.location.href = href;
104                } else {
105                    $(this).attr("href", href);
106                }
107            }
108        } else {
109            showIndiaTip(e, styleLoginTip_India, goIndiaTipHtml, href);
110        }
111    })
112
113});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.