1<!-- 2//xmlhttpºÍxmldom¶ÔÏó 3var DedeXHTTP = null; 4var DedeXDOM = null; 5var DedeContainer = null; 6var DedeShowError = false; 7var DedeShowWait = false; 8var DedeErrCon = ""; 9var DedeErrDisplay = "ÏÂÔØÊý¾Ýʧ°Ü"; 10var DedeWaitDisplay = "ÕýÔÚÏÂÔØÊý¾Ý..."; 11 12//»ñȡָ¶¨IDµÄÔªËØ 13 14function $DE(id) { 15 return document.getElementById(id); 16} 17 18//gcontainer ÊDZ£´æÏÂÔØÍê³ÉµÄÄÚÈݵÄÈÝÆ÷ 19//mShowError ÊÇ·ñÌáʾ´íÎóÐÅÏ¢ 20//DedeShowWait ÊÇ·ñÌáʾµÈ´ýÐÅÏ¢ 21//mErrCon ·þÎñÆ÷·µ»ØÊ²Ã´×Ö·û´®ÊÓΪ´íÎó 22//mErrDisplay ·¢Éú´íÎóʱÏÔʾµÄÐÅÏ¢ 23//mWaitDisplay µÈ´ýʱÌáʾÐÅÏ¢ 24//ĬÈϵ÷Óà DedeAjax('divid',false,false,'','','') 25 26function DedeAjax(gcontainer,mShowError,mShowWait,mErrCon,mErrDisplay,mWaitDisplay) 27{ 28 29 DedeContainer = gcontainer; 30 DedeShowError = mShowError; 31 DedeShowWait = mShowWait; 32 if(mErrCon!="") DedeErrCon = mErrCon; 33 if(mErrDisplay!="") DedeErrDisplay = mErrDisplay; 34 if(mErrDisplay=="x") DedeErrDisplay = ""; 35 if(mWaitDisplay!="") DedeWaitDisplay = mWaitDisplay; 36 37 38 //post»òget·¢ËÍÊý¾ÝµÄ¼üÖµ¶Ô 39 this.keys = Array(); 40 this.values = Array(); 41 this.keyCount = -1; 42 this.sendlang = 'gb2312'; 43 44 //ÇëÇóÍ·ÀàÐÍ 45 this.rtype = 'text'; 46 47 //³õʼ»¯xmlhttp 48 //IE6¡¢IE5 49 if(window.ActiveXObject) { 50 try { DedeXHTTP = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { } 51 if (DedeXHTTP == null) try { DedeXHTTP = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { } 52 } 53 else { 54 DedeXHTTP = new XMLHttpRequest(); 55 } 56 57 //Ôö¼ÓÒ»¸öPOST»òGET¼üÖµ¶Ô 58 this.AddKeyN = function(skey,svalue) { 59 if(this.sendlang=='utf-8') this.AddKeyUtf8(skey, svalue); 60 else this.AddKey(skey, svalue); 61 }; 62 63 this.AddKey = function(skey,svalue) { 64 this.keyCount++; 65 this.keys[this.keyCount] = skey; 66 svalue = svalue+''; 67 if(svalue != '') svalue = svalue.replace(/\+/g,'$#$'); 68 this.values[this.keyCount] = escape(svalue); 69 }; 70 71 //Ôö¼ÓÒ»¸öPOST»òGET¼üÖµ¶Ô 72 this.AddKeyUtf8 = function(skey,svalue) { 73 this.keyCount++; 74 this.keys[this.keyCount] = skey; 75 svalue = svalue+''; 76 if(svalue != '') svalue = svalue.replace(/\+/g,'$#$'); 77 this.values[this.keyCount] = encodeURI(svalue); 78 }; 79 80 //Ôö¼ÓÒ»¸öHttpÇëÇóÍ·¼üÖµ¶Ô 81 this.AddHead = function(skey,svalue) { 82 this.rkeyCount++; 83 this.rkeys[this.rkeyCount] = skey; 84 this.rvalues[this.rkeyCount] = svalue; 85 }; 86 87 //Çå³ýµ±Ç°¶ÔÏóµÄ¹þÏ£±í²ÎÊý 88 this.ClearSet = function() { 89 this.keyCount = -1; 90 this.keys = Array(); 91 this.values = Array(); 92 this.rkeyCount = -1; 93 this.rkeys = Array(); 94 this.rvalues = Array(); 95 }; 96 97 98 DedeXHTTP.onreadystatechange = function() { 99 //ÔÚIE6Öв»¹Ü×è¶Ï»òÒ첽ģʽ¶¼»áÖ´ÐÐÕâ¸öʼþµÄ 100 if(DedeXHTTP.readyState == 4){ 101 if(DedeXHTTP.status == 200) 102 { 103 if(DedeXHTTP.responseText!=DedeErrCon) { 104 DedeContainer.innerHTML = DedeXHTTP.responseText; 105 } 106 else { 107 if(DedeShowError) DedeContainer.innerHTML = DedeErrDisplay; 108 } 109 DedeXHTTP = null; 110 } 111 else { if(DedeShowError) DedeContainer.innerHTML = DedeErrDisplay; } 112 } 113 else { if(DedeShowWait) DedeContainer.innerHTML = DedeWaitDisplay; } 114 }; 115 116 //¼ì²â×è¶ÏģʽµÄ״̬ 117 this.BarrageStat = function() { 118 if(DedeXHTTP==null) return; 119 if(typeof(DedeXHTTP.status)!=undefined && DedeXHTTP.status == 200) 120 { 121 if(DedeXHTTP.responseText!=DedeErrCon) { 122 DedeContainer.innerHTML = DedeXHTTP.responseText; 123 } 124 else { 125 if(DedeShowError) DedeContainer.innerHTML = DedeErrDisplay; 126 } 127 } 128 }; 129 130 //·¢ËÍhttpÇëÇóÍ· 131 this.SendHead = function() 132 { 133 //·¢ËÍÓû§×ÔÐÐÉ趨µÄÇëÇóÍ· 134 if(this.rkeyCount!=-1) 135 { 136 for(var i = 0;i<=this.rkeyCount;i++) 137 { 138 DedeXHTTP.setRequestHeader(this.rkeys[i],this.rvalues[i]); 139 } 140 } 141 ¡¡if(this.rtype=='binary'){ 142 ¡¡DedeXHTTP.setRequestHeader("Content-Type","multipart/form-data"); 143 }else{ 144 DedeXHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 145 } 146}; 147 148//ÓÃPost·½Ê½·¢ËÍÊý¾Ý 149this.SendPost = function(purl) { 150 var pdata = ""; 151 var i=0; 152 this.state = 0; 153 DedeXHTTP.open("POST", purl, true); 154 this.SendHead();
155 //postÊý¾Ý 156 if(this.keyCount!=-1) 157 { 158 for(;i<=this.keyCount;i++) 159 { 160 if(pdata=="") pdata = this.keys[i]+'='+this.values[i]; 161 else pdata += "&"+this.keys[i]+'='+this.values[i]; 162 } 163 } 164 DedeXHTTP.send(pdata); 165}; 166 167//ÓÃGET·½Ê½·¢ËÍÊý¾Ý 168this.SendGet = function(purl) { 169 var gkey = ""; 170 var i=0; 171 this.state = 0; 172 //get²ÎÊý 173 if(this.keyCount!=-1) 174 { 175 for(;i<=this.keyCount;i++) 176 { 177 if(gkey=="") gkey = this.keys[i]+'='+this.values[i]; 178 else gkey += "&"+this.keys[i]+'='+this.values[i]; 179 } 180 if(purl.indexOf('?')==-1) purl = purl + '?' + gkey; 181 else purl = purl + '&' + gkey; 182 } 183 DedeXHTTP.open("GET", purl, true); 184 this.SendHead(); 185 DedeXHTTP.send(null); 186}; 187 188//ÓÃGET·½Ê½·¢ËÍÊý¾Ý£¬×èÈûģʽ 189this.SendGet2 = function(purl) { 190 var gkey = ""; 191 var i=0; 192 this.state = 0; 193 //get²ÎÊý 194 if(this.keyCount!=-1) 195 { 196 for(;i<=this.keyCount;i++) 197 { 198 if(gkey=="") gkey = this.keys[i]+'='+this.values[i]; 199 else gkey += "&"+this.keys[i]+'='+this.values[i]; 200 } 201 if(purl.indexOf('?')==-1) purl = purl + '?' + gkey; 202 else purl = purl + '&' + gkey; 203 } 204 DedeXHTTP.open("GET", purl, false); 205 this.SendHead(); 206 DedeXHTTP.send(null); 207 //firefoxÖÐÖ±½Ó¼ì²âXHTTP״̬ 208 this.BarrageStat(); 209}; 210 211//ÓÃPost·½Ê½·¢ËÍÊý¾Ý 212this.SendPost2 = function(purl) { 213 var pdata = ""; 214 var i=0; 215 this.state = 0; 216 DedeXHTTP.open("POST", purl, false); 217 this.SendHead(); 218 //postÊý¾Ý 219 if(this.keyCount!=-1) 220 { 221 for(;i<=this.keyCount;i++) 222 { 223 if(pdata=="") pdata = this.keys[i]+'='+this.values[i]; 224 else pdata += "&"+this.keys[i]+'='+this.values[i]; 225 } 226 } 227 DedeXHTTP.send(pdata); 228 //firefoxÖÐÖ±½Ó¼ì²âXHTTP״̬ 229 this.BarrageStat(); 230}; 231 232 233} // End Class DedeAjax 234 235//³õʼ»¯xmldom 236function InitXDom() { 237 if(DedeXDOM!=null) return; 238 var obj = null; 239 // Gecko¡¢Mozilla¡¢Firefox 240 if (typeof(DOMParser) != "undefined") { 241 var parser = new DOMParser(); 242 obj = parser.parseFromString(xmlText, "text/xml"); 243 } 244 // IE 245 else { 246 try { obj = new ActiveXObject("MSXML2.DOMDocument");} catch (e) { } 247 if (obj == null) try { obj = new ActiveXObject("Microsoft.XMLDOM"); } catch (e) { } 248 } 249 DedeXDOM = obj; 250}; 251 252 253 254//¶Áдcookieº¯Êý 255function GetCookie(c_name) 256{ 257 if (document.cookie.length > 0) 258 { 259 c_start = document.cookie.indexOf(c_name + "=") 260 if (c_start != -1) 261 { 262 c_start = c_start + c_name.length + 1; 263 c_end = document.cookie.indexOf(";",c_start); 264 if (c_end == -1) 265 { 266 c_end = document.cookie.length; 267 } 268 return unescape(document.cookie.substring(c_start,c_end)); 269 } 270 } 271 return null 272} 273 274function SetCookie(c_name,value,expiredays) 275{ 276 var exdate = new Date(); 277 exdate.setDate(exdate.getDate() + expiredays); 278 document.cookie = c_name + "=" +escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //ʹÉèÖõÄÓÐЧʱ¼äÕýÈ·¡£Ôö¼ÓtoGMTString() 279} 280 281-->
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.