repl.it
@anonymous/

SpotlessAntiqueActivecontent

JavaScript

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
 var xmlhttp = new XMLHttpRequest();
 
 xmlhttp.onreadystatechange = function() {
    var data = JSON.parse(xmlhttp.responseText);
    var temp = Math.round(data.main.temp - 273);
    
    console.log('Temp in London:', temp, '°C');
}

xmlhttp.open("GET", "//api.openweathermap.org/data/2.5/weather?q=London");
xmlhttp.send();
Native Browser JavaScript