1// Mail Chimp AjaxRequest object constructor 2function MCAjaxRequest() { 3 // Try the XMLHttpRequest object first 4 if (window.XMLHttpRequest) { 5 try { 6 this.request = new XMLHttpRequest(); 7 } catch(e) { 8 this.request = null; 9 } 10 // Now try the ActiveX (IE) version 11 } else if (window.ActiveXObject) { 12 try { 13 this.request = new ActiveXObject("Msxml2.XMLHTTP"); 14 // Try the older ActiveX object for older versions of IE 15 } catch(e) { 16 try { 17 this.request = new ActiveXObject("Microsoft.XMLHTTP"); 18 } catch(e) { 19 this.request = null; 20 } 21 } 22 } 23 24 // If the request creation failed, notify the user 25 if (this.request == null) 26 alert("Ajax error creating the request.\n" + "Details: " + e); 27 } 28 29 // Send an Ajax request to the server 30 MCAjaxRequest.prototype.send = function(type, url, handler, postDataType, postData) { 31 if (this.request != null) { 32 // Kill the previous request 33 this.request.abort(); 34 35 // Tack on a dummy parameter to override browser caching 36 url += "?dummy=" + new Date().getTime(); 37 38 try { 39 this.request.onreadystatechange = handler; 40 this.request.open(type, url, true); // always asynchronous (true) 41 if (type.toLowerCase() == "get") { 42 // Send a GET request; no data involved 43 this.request.send(null); 44 } else { 45 // Send a POST request; the last argument is data 46 this.request.setRequestHeader("Content-Type", postDataType); 47 this.request.send(postData); 48 } 49 } catch(e) { 50 alert("Ajax error communicating with the server.\n" + "Details: " + e); 51 } 52 } 53} // end of MCAjaxRequest 54 55MCAjaxRequest.prototype.getReadyState = function() { 56 return this.request.readyState; 57} 58 59MCAjaxRequest.prototype.getStatus = function() { 60 return this.request.status; 61} 62 63MCAjaxRequest.prototype.getResponseText = function() { 64 return this.request.responseText; 65} 66 67MCAjaxRequest.prototype.getResponseXML = function() { 68 return this.request.responseXML; 69}
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.