Topic 1905770

https://gathering.tweakers.net/forum/list_messages/1905770

by Rob Janssen

HTML

<!DOCTYPE html>
<html>
<body>


<script>
(function() {
  var newXHR = null;

  function sendXHR(type, url, data, callback) {
    newXHR = new XMLHttpRequest() || new window.ActiveXObject("Microsoft.XMLHTTP");
    newXHR.open(type, url, true);
    newXHR.send(data);
    newXHR.onreadystatechange = function() { // Use onreadystatechange instead onload.
      if (this.status === 200 && this.readyState === 4) {
        callback(this.response);
      }
    };
  }

  sendXHR("GET", "http://weerlive.nl/api/json-data-10min.php?key=demo&locatie=Amsterdam", null, function(response) 
{var data = JSON.parse(response);document.getElementById("output").innerHTML = data.liveweer.0.verw;});}());
</script>

<div id="container">
  <div id="output">
</div>


</body>
</html>