PageSourceSearch

https://www.alljournals.cn/ch/js/ajax.js

js alljournals.cn collected 2026-10-03 17:34:06 UTC 3,281 bytes, 121 lines download raw bytes

1function DedeAjax(WiteOKFunc){ //WiteOKFunc ΪÒ첽״̬ʼþ´¦Àíº¯Êý 
2	//xmlhttpºÍxmldom¶ÔÏó
3	this.xhttp = null;
4	this.xdom = null;
5
6	//post»òget·¢ËÍÊý¾ÝµÄ¼üÖµ¶Ô
7	this.keys = Array();
8	this.values = Array();
9	this.keyCount = -1;
10
11	//httpÇëÇóÍ·
12	this.rkeys = Array();
13	this.rvalues = Array();
14	this.rkeyCount = -1;
15	//ÇëÇóÍ·ÀàÐÍ
16	this.rtype = 'text';
17
18	//³õʼ»¯xmlhttp
19	if(window.ActiveXObject){//IE6¡¢IE5
20		try { 
21			this.xhttp = new ActiveXObject("Microsoft.XMLHTTP");
22		} catch (e) {		
23		}
24		if (this.xhttp == null){ 
25			try { 
26				this.xhttp = new ActiveXObject("Msxml2.XMLHTTP");
27			} catch (e) { }
28		}
29	}else if(window.XMLHttpRequest){//IE7, Mozilla ,Firefox µÈä¯ÀÀÆ÷ÄÚÖøöÔÏó
30		this.xhttp = new XMLHttpRequest();
31	}
32	this.xhttp.onreadystatechange = WiteOKFunc;
33	//rs: responseBody¡¢responseStream¡¢responseXml¡¢responseText
34
35	//ÒÔÏÂΪ³ÉÔ±º¯Êý
36	//--------------------------------
37	//³õʼ»¯xmldom
38	this.InitXDom = function(){
39		 var obj = null;
40		 if (typeof(DOMParser) != "undefined") { // Gecko¡¢Mozilla¡¢Firefox
41		   var parser = new DOMParser();
42		   obj = parser.parseFromString(xmlText, "text/xml");
43		 } else { // IE
44		   try { obj = new ActiveXObject("MSXML2.DOMDocument");} catch (e) { }
45		   if (obj == null) try { obj = new ActiveXObject("Microsoft.XMLDOM"); } catch (e) { }
46		 }
47		 this.xdom = obj;
48	};
49	//Ôö¼ÓÒ»¸öPOST»òGET¼üÖµ¶Ô
50	this.AddKey = function(skey,svalue){
51		this.keyCount++;
52		this.keys[this.keyCount] = skey;
53		this.values[this.keyCount] = escape(svalue);
54	};
55
56	//Ôö¼ÓÒ»¸öHttpÇëÇóÍ·¼üÖµ¶Ô
57	this.AddHead = function(skey,svalue){
58		this.rkeyCount++;
59		this.rkeys[this.rkeyCount] = skey;
60		this.rvalues[this.rkeyCount] = svalue;
61	};
62
63	//Çå³ýµ±Ç°¶ÔÏóµÄ¹þÏ£±í²ÎÊý
64	this.ClearSet = function(){
65		this.keyCount = -1;
66		this.keys = Array();
67		this.values = Array();
68		this.rkeyCount = -1;
69		this.rkeys = Array();
70		this.rvalues = Array();
71	};
72
73	//·¢ËÍhttpÇëÇóÍ·
74	this.SendHead = function(){
75		if(this.rkeyCount!=-1){ //·¢ËÍÓû§×ÔÐÐÉ趨µÄÇëÇóÍ·
76		  for(;i<=this.rkeyCount;i++){
77		   this.xhttp.setRequestHeader(this.rkeys[i],this.rvalues[i]); 
78		  }
79		 }
80		¡¡if(this.rtype=='binary'){
81		  this.xhttp.setRequestHeader("Content-Type","multipart/form-data");
82		 }else{
83		  this.xhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
84		 }
85	};
86
87	//ÓÃPost·½Ê½·¢ËÍÊý¾Ý
88	this.SendPost = function(purl){
89		var pdata = "";
90		var i=0;
91		this.state = 0;
92		this.xhttp.open("POST", purl, true); 
93		this.SendHead();
94		 if(this.keyCount!=-1){ //postÊý¾Ý
95		  for(;i<=this.keyCount;i++){
96		   if(pdata=="") pdata = this.keys[i]+'='+this.values[i];
97		   else pdata += "&"+this.keys[i]+'='+this.values[i];
98		  }
99		 }
100		 this.xhttp.send(pdata);
101	};
102
103	//ÓÃGET·½Ê½·¢ËÍÊý¾Ý
104	this.SendGet = function(purl){
105		var gkey = "";
106		var i=0;
107		this.state = 0;
108		if(this.keyCount!=-1){ //get²ÎÊý
109		  for(;i<=this.keyCount;i++){
110		   if(gkey=="") gkey = this.keys[i]+'='+this.values[i];
111		   else gkey += "&"+this.keys[i]+'='+this.values[i];
112		  }
113		  if(purl.indexOf('?')==-1) purl = purl + '?' + gkey;
114		  else  purl = purl + '&' + gkey;
115		 }
116		this.xhttp.open("GET", purl, true); 
117		this.SendHead();
118		 this.xhttp.send();
119	};
120} // End Class DedeAjax
121

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.