// withCredentials should be set after "open" for Safari and Chrome (< 19 ?)
xhr.withCredentials=this.withCredentials
xhr.responseType=this.responseType
try{
// xhr.send(); throws "Not enough arguments" in Firefox 3.0
xhr.send(undefined)
}catch(error1){
// Safari 5.1.7, Opera 12
throwerror1
}
}
functiontoLowerCase(name){
returnname.replace(/[A-Z]/g,function(c){
returnString.fromCharCode(c.charCodeAt(0)+0x20)
})
}
functionHeadersPolyfill(all){
// Get headers: implemented according to mozilla's example code: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
message="EventSource's response has a status "+status+' '+statusText+' that is not 200. Aborting the connection.'
}else{
message="EventSource's response has a Content-Type specifying an unsupported type: "+(contentType==undefined?'-':contentType.replace(/\s+/g,' '))+'. Aborting the connection.'