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 æ¯ä¿åä¸è½½å®æçå 容çå®¹å¨ 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 43 //http请æ±å¤´ 44 this.rkeys = Array(); 45 this.rvalues = Array(); 46 this.rkeyCount = -1; 47 48 //请æ±å¤´ç±»å 49 this.rtype = 'text'; 50 51 //åå§åxmlhttp 52 //IE6ãIE5 53 if(window.ActiveXObject) { 54 try { DedeXHTTP = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { } 55 if (DedeXHTTP == null) try { DedeXHTTP = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { } 56 } 57 else { 58 DedeXHTTP = new XMLHttpRequest(); 59 } 60 61 //å¢å ä¸ä¸ªPOSTæGETé®å¼å¯¹ 62 this.AddKey = function(skey,svalue) { 63 this.keyCount++; 64 this.keys[this.keyCount] = skey; 65 svalue = svalue.replace(/\+/g,'$#$'); 66 this.values[this.keyCount] = escape(svalue); 67 }; 68 69 //å¢å ä¸ä¸ªPOSTæGETé®å¼å¯¹ 70 this.AddKeyUtf8 = function(skey,svalue) { 71 this.keyCount++; 72 this.keys[this.keyCount] = skey; 73 svalue = svalue.replace(/\+/g,'$#$'); 74 this.values[this.keyCount] = encodeURI(svalue); 75 }; 76 77 //å¢å ä¸ä¸ªHttp请æ±å¤´é®å¼å¯¹ 78 this.AddHead = function(skey,svalue) { 79 this.rkeyCount++; 80 this.rkeys[this.rkeyCount] = skey; 81 this.rvalues[this.rkeyCount] = svalue; 82 }; 83 84 //æ¸ é¤å½å对象çåå¸è¡¨åæ° 85 this.ClearSet = function() { 86 this.keyCount = -1; 87 this.keys = Array(); 88 this.values = Array(); 89 this.rkeyCount = -1; 90 this.rkeys = Array(); 91 this.rvalues = Array(); 92 }; 93 94 95 DedeXHTTP.onreadystatechange = function() { 96 //å¨IE6ä¸ä¸ç®¡é»ææå¼æ¥æ¨¡å¼é½ä¼æ§è¡è¿ä¸ªäºä»¶ç 97 if(DedeXHTTP.readyState == 4){ 98 if(DedeXHTTP.status == 200) 99 { 100 if(DedeXHTTP.responseText!=DedeErrCon) { 101 DedeContainer.innerHTML = DedeXHTTP.responseText; 102 } 103 else { 104 if(DedeShowError) DedeContainer.innerHTML = DedeErrDisplay; 105 } 106 DedeXHTTP = null; 107 } 108 else { if(DedeShowError) DedeContainer.innerHTML = DedeErrDisplay; } 109 } 110 else { if(DedeShowWait) DedeContainer.innerHTML = DedeWaitDisplay; } 111 }; 112 113 //æ£æµé»ææ¨¡å¼çç¶æ 114 this.BarrageStat = function() { 115 if(DedeXHTTP==null) return; 116 if(typeof(DedeXHTTP.status)!=undefined && DedeXHTTP.status == 200) 117 { 118 if(DedeXHTTP.responseText!=DedeErrCon) { 119 DedeContainer.innerHTML = DedeXHTTP.responseText; 120 } 121 else { 122 if(DedeShowError) DedeContainer.innerHTML = DedeErrDisplay; 123 } 124 } 125 }; 126 127 //åéhttp请æ±å¤´ 128 this.SendHead = function() 129 { 130 if(this.rkeyCount!=-1) 131 { 132 for(;i<=this.rkeyCount;i++) 133 { 134 DedeXHTTP.setRequestHeader(this.rkeys[i],this.rvalues[i]); 135 } 136 } 137 if(this.rtype=='binary') { 138 DedeXHTTP.setRequestHeader("Content-Type","multipart/form-data"); 139 } 140 else { 141 DedeXHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 142 } 143}; 144 145//ç¨Postæ¹å¼åéæ°æ® 146this.SendPost = function(purl) { 147 var pdata = ""; 148 var i=0; 149 this.state = 0; 150 DedeXHTTP.open("POST", purl, true); 151 this.SendHead(); 152 //postæ°æ® 153 if(this.keyCount!=-1) 154 { 155 for(;i<=this.keyCount;i++) 156 { 157 if(pdata=="") pdata = this.keys[i]+'='+this.values[i]; 158 else pdata += "&"+this.keys[i]+'='+this.values[i]; 159 } 160 } 161 DedeXHTTP.send(pdata); 162}; 163 164//ç¨GETæ¹å¼åéæ°æ® 165this.SendGet = function(purl) { 166 var gkey = ""; 167 var i=0; 168 this.state = 0; 169 //getåæ° 170 if(this.keyCount!=-1) 171 { 172 for(;i<=this.keyCount;i++) 173 { 174 if(gkey=="") gkey = this.keys[i]+'='+this.values[i]; 175 else gkey += "&"+this.keys[i]+'='+this.values[i]; 176 } 177 if(purl.indexOf('?')==-1) purl = purl + '?' + gkey; 178 else purl = purl + '&' + gkey; 179 } 180 DedeXHTTP.open("GET", purl, true); 181 this.SendHead(); 182 DedeXHTTP.send(null); 183}; 184 185//ç¨GETæ¹å¼åéæ°æ®ï¼é»å¡æ¨¡å¼ 186this.SendGet2 = function(purl) { 187 var gkey = ""; 188 var i=0; 189 this.state = 0; 190 //getåæ° 191 if(this.keyCount!=-1) 192 { 193 for(;i<=this.keyCount;i++) 194 { 195 if(gkey=="") gkey = this.keys[i]+'='+this.values[i]; 196 else gkey += "&"+this.keys[i]+'='+this.values[i]; 197 } 198 if(purl.indexOf('?')==-1) purl = purl + '?' + gkey; 199 else purl = purl + '&' + gkey; 200 } 201 DedeXHTTP.open("GET", purl, false); 202 this.SendHead(); 203 DedeXHTTP.send(null); 204 //firefoxä¸ç´æ¥æ£æµXHTTPç¶æ 205 this.BarrageStat(); 206}; 207 208//ç¨Postæ¹å¼åéæ°æ® 209this.SendPost2 = function(purl) { 210 var pdata = ""; 211 var i=0; 212 this.state = 0; 213 DedeXHTTP.open("POST", purl, false); 214 this.SendHead(); 215 //postæ°æ® 216 if(this.keyCount!=-1) 217 { 218 for(;i<=this.keyCount;i++) 219 {
220 if(pdata=="") pdata = this.keys[i]+'='+this.values[i]; 221 else pdata += "&"+this.keys[i]+'='+this.values[i]; 222 } 223 } 224 DedeXHTTP.send(pdata); 225 //firefoxä¸ç´æ¥æ£æµXHTTPç¶æ 226 this.BarrageStat(); 227}; 228 229 230} // End Class DedeAjax 231 232//åå§åxmldom 233function InitXDom() { 234 if(DedeXDOM!=null) return; 235 var obj = null; 236 // GeckoãMozillaãFirefox 237 if (typeof(DOMParser) != "undefined") { 238 var parser = new DOMParser(); 239 obj = parser.parseFromString(xmlText, "text/xml"); 240 } 241 // IE 242 else { 243 try { obj = new ActiveXObject("MSXML2.DOMDocument");} catch (e) { } 244 if (obj == null) try { obj = new ActiveXObject("Microsoft.XMLDOM"); } catch (e) { } 245 } 246 DedeXDOM = obj; 247}; 248 249 250 251//读åcookie彿° 252function GetCookie(c_name) 253{ 254 if (document.cookie.length > 0) 255 { 256 c_start = document.cookie.indexOf(c_name + "=") 257 if (c_start != -1) 258 { 259 c_start = c_start + c_name.length + 1; 260 c_end = document.cookie.indexOf(";",c_start); 261 if (c_end == -1) 262 { 263 c_end = document.cookie.length; 264 } 265 return unescape(document.cookie.substring(c_start,c_end)); 266 } 267 } 268 return null 269} 270 271function SetCookie(c_name,value,expiredays) 272{ 273 var exdate = new Date(); 274 exdate.setDate(exdate.getDate() + expiredays); 275 document.cookie = c_name + "=" +escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //ä½¿è®¾ç½®çæææ¶é´æ£ç¡®ãå¢å toGMTString() 276} 277 278-->
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.