PageSourceSearch

https://www.shannan.gov.cn/images/alert.min.js

js shannan.gov.cn collected 2026-10-02 16:50:49 UTC 5,591 bytes, 114 lines download raw bytes

1
2(function(win) {
3	var _alert = document.createElement("div");
4	_alert.className = "alert_box";
5	_alert.innerHTML = ".<style type='text/css'>.clearfix:after{content:'.';display:block;height:0;clear:both;visibility:hidden}.alert_box{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;z-index:99999;}.alert_black{position:absolute;top:0px;left:0px;width:100%;height:100%;background-color:#000;background-color:#000; /* older safari/Chrome browsers */-webkit-opacity: 0.7;/* Netscape and Older than Firefox 0.9 */-moz-opacity: 0.7;/* Safari 1.x (pre WebKit!) 老式khtml内核的Safari浏览器*/-khtml-opacity: 0.7;/* IE9 + etc...modern browsers */opacity: .7;/* IE 4-9 */filter:alpha(opacity=70);/*This works in IE 8 & 9 too*/-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=70)';/*IE4-IE9*/filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=70);}.alert{display:block;position:fixed;left:50%;top:50%;color:#FFF;margin-left:-200px;margin-top:-100px;width:430px;height:200px;background-color:#FFFFFF;-moz-border-radius: 5px; /* Firefox */-webkit-border-radius: 5px; /* Safari 和 Chrome */border-radius: 5px; /* Opera 10.5+, 以及使用了IE-CSS3的IE浏览器 */z-index:100000;}.alert_centent{padding:50px 30px;line-height:30px;color:#333;font-size:16px;text-align: center;}.alert_btn{position:absolute;top:0;right:0;color:#333 !important;padding:0 10px;cursor:pointer;font:18px/30px '微软雅黑' !important;}.alert_closebtn{position: absolute;top:10px;right:10px;color:#ADADAD;padding:10px;cursor: pointer;}.alert_bot{position:absolute;bottom:0px;left:0px;width:100%;background-color:#ADADAD;border-top:1px solid #777777; -moz-border-radius: 0px 0px 5px 5px; /* Firefox */-webkit-border-radius: 0px 0px 5px 5px; /* Safari 和 Chrome */border-radius: 0px 0px 5px 5px; /* Opera 10.5+, 以及使用了IE-CSS3的IE浏览器 */}.alert_cancle,.alert_href{float:right;cursor:pointer;text-decoration:none; -moz-border-radius:5px; /* Firefox */-webkit-border-radius:5px; /* Safari 和 Chrome */border-radius:5px; /* Opera 10.5+, 以及使用了IE-CSS3的IE浏览器 */}.alert_cancle{display:block;padding:0px 15px;font:14px/30px '微软雅黑'!important;color:#333 !important;background-color:#fff;margin:10px 15px 10px 0px;}.alert_href{display:block;padding: 0px 15px;font:14px/30px '微软雅黑'!important;color:#fff!important;background-color:#337ab7;margin:10px 15px 10px 0px;}</style><div class='alert_black'></div><div class='alert'><div class='alert_centent'>您访问的链接即将离开“山南市人民政府”门户网站<br/>是否继续?</div><div class='alert_bot clearfix'><a data-id='go' class='alert_href' href>继续访问</a><a data-id='close' class='alert_cancle'>放弃</a></div><a data-id='close' class='alert_btn'>x</a></div>";
6	document.body.appendChild(_alert);
7
8	var _location = win.location.hostname;
9	var url = new RegExp(_location);
10	var _blankURL = "";
11	var mod = {
12		close: function() {
13			_alert.style.display = "none"
14		},
15		go: function() {
16			_alert.style.display = "none";
17			var goBtn = document.getElementsByClassName('alert_href')[0];
18			goBtn.href = _blankURL;
19			goBtn.setAttribute('target', '_blank')
20		},
21		isA: function(node) {
22			if(node.nodeName.toLowerCase() === "a") {
23				return node
24			} else if(node.parentNode) {
25				return arguments.callee(node.parentNode)
26			} else {
27				return false
28			}
29		}
30	};
31	var addEvent = function(obj, type, handle) {
32		try {
33			obj.addEventListener(type, handle, false)
34		} catch(e) {
35			try {
36				obj.attachEvent('on' + type, handle)
37			} catch(e) {
38				obj['on' + type] = handle
39			}
40		}
41	};
42	addEvent(document, "click", function(e) {
43		var e = e || window.event;
44		var node = e.target || e.srcElement;
45		var node_A = mod.isA(node);
46		
47		var oldTarget=node_A.getAttribute('target');
48				console.log(oldTarget)
49		if(node_A) {
50		
51			var fn = node_A.getAttribute("data-id");
52
53			if(node_A && fn === null) {
54				var gov = node_A.href.indexOf("/shuangliu/");
55
56				//var sjkf = node_A.href.indexOf("http://data.pidu.gov.cn/index.php?m=Opendata");
57				var sjkf = -1;
58				var ipUrl = -1;
59				//var ipUrl = node_A.href.indexOf("221.237.182.93:6015");
60				
61				var class_name1=node_A.className.indexOf('pagination-num');
62				
63				var class_name2=node_A.className.indexOf('pagination-index');
64					
65
66					if(!url.test(node_A.href) && !/^(javascript:)/.test(node_A.href) && node_A.href && node_A.href !== '' && gov == -1 && ipUrl == -1&&class_name1==-1&&class_name2==-1&&sjkf==-1) {
67
68						_blankURL = node_A.href;
69						_alert.style.display = "block";
70	
71						if(e && e.preventDefault) {
72							e.preventDefault()
73						} else {
74							window.event.returnValue = false
75						}
76						return false
77					} else if(gov !== -1) {
78						
79						console.log(11111)
80						
81						if(oldTarget=='_self'||oldTarget==""||oldTarget==null){	
82										
83								console.log(22222)
84						
85								node_A.setAttribute('target', '_self');	
86						}else if(oldTarget=="_blank"){
87							
88							console.log(3333)
89								node_A.setAttribute('target', '_blank');	
90						}	
91
92						
93					}else if(sjkf !==-1){
94						
95						node_A.setAttribute('target', '_blank');
96						
97					}else if(ipUrl !== -1){
98						
99						node_A.setAttribute('target', '_blank');
100						
101					}else if(class_name1!==-1||class_name2!==-1){
102						
103						node_A.setAttribute('target', '_self');
104					}
105			} 
106			else {
107				if(fn !== null) {					
108					mod[fn]()
109				}
110			}
111		}
112	})
113})(typeof window !== undefined ? window : this);
114

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.