PageSourceSearch

https://dongzhi.gov.cn/dist/js/domain.js

js dongzhi.gov.cn collected 2026-10-04 02:53:09 UTC 1,807 bytes, 42 lines download raw bytes

1var getHost = function(url) {
2    var host = "null";
3    if (typeof url == "undefined" || null == url) url = window.location.host;
4    var regex = /^\/[\w\/]*/;
5    var match = url.match(regex);
6    if (typeof match != "undefined" && null != match) host = window.location.host;
7    return host;
8};
9$(document).ready(function () {
10    var domain = 'gov.cn',ignore = window.location.hostname;
11    $("a").click(function(){
12        var o = $(this);
13        var url = o.attr('href'),host = getHost(url);
14        if(url == undefined || url == '' ){
15            return;
16        }
17        if (host.indexOf(domain) == -1 && host.indexOf(ignore) == -1 && url.indexOf(domain) == -1 && url.indexOf(ignore) == -1 && url.indexOf("javascript") && url.indexOf('#') == -1 && url != "#"){
18            $(this).attr('target','_self');
19            $(this).attr('href','javascript:void(0)');
20            var w = '480px';
21            var h = '170px';
22            var siteName = $("meta[name=SiteName]").attr('content');
23            if (!siteName) {
24                siteName = '东至县人民政府';
25            }
26            if(window.screen.width < 768) { w = '90%'; h = '170px';}
27            var cf = layer.confirm('<div style="margin-top:15px; font-size:16px;">您访问的链接即将离开“' + siteName + '网站”,将访问外部链接地址为' + url + ',是否继续?</div>', {
28                btn:[ '继续访问', '放弃' ],
29                title: false,
30                shade: 0.7,
31                area: [w, h],
32                cancel: function(index){ o.attr('href',url); }
33            }, function() {
34                window.open(url);
35                o.attr('href',url);
36                layer.close(cf);
37            }, function() {
38                o.attr('href',url);
39            });
40        }
41    });
42});

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.