getRequest: function(link) {
var $this = this;
var request = new XMLHttpRequest();
request.open('GET', link , true)
request.onreadystatechange = function(e) {
if (this.readyState == 4) {
if(this.status == 200) {
var response = JSON.parse(this.responseText);
console.log(response);
$this.showWeatherData(response);
}
}
}
request.send(null);
},
так например