Created
February 27, 2019 23:36
-
-
Save humrochagf/e52646ea66d05e3a3076104f7b7e7773 to your computer and use it in GitHub Desktop.
Tio Gilberto
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
<!doctype html> | |
<html lang="pt-br"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>Hello, world!</title> | |
</head> | |
<body> | |
<button type="button" onClick="httpGet('https://jsonplaceholder.typicode.com/todos/1')">Clique</button> | |
<script> | |
function httpGet(link) { | |
var xmlHttp = new XMLHttpRequest(); | |
xmlHttp.open( "GET", link, false ); // false for synchronous request | |
xmlHttp.send( null ); | |
var result = xmlHttp.responseText; | |
console.log(result); | |
return result; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tio, daí você só precisa adicionar estes buttons e alí no onClick dentro das aspas simples você troca o endereço que eu coloquei de exemplo pelo endereço de cada led