Skip to content

Instantly share code, notes, and snippets.

@humrochagf
Created February 27, 2019 23:36
Show Gist options
  • Save humrochagf/e52646ea66d05e3a3076104f7b7e7773 to your computer and use it in GitHub Desktop.
Save humrochagf/e52646ea66d05e3a3076104f7b7e7773 to your computer and use it in GitHub Desktop.
Tio Gilberto
<!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>
@humrochagf
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment