Created
December 20, 2019 09:56
-
-
Save loristissino/c162bb43edccdf4e2721860ce5ca368b to your computer and use it in GitHub Desktop.
javascript http request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = "https://example.com/"; | |
const http = new XMLHttpRequest(); | |
http.open("GET", url); | |
http.send(); | |
http.onload = function() { | |
var temperature = http.responseText; | |
temperatureEl.innerHTML = temperature; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment