xmlhttprequest javascript header code example
Example 1: js xmlhttprequest add header
XMLHttpRequest.setRequestHeader(header, value)
Example 2: xmlhttprequest javascript
function reqListener () {
console.log(this.responseText);
}
var oReq = new XMLHttpRequest();
oReq.onload = reqListener;
oReq.open("GET", "http://www.example.org/example.txt");
oReq.send();