trimill.xyz/flaskr/templates/projects/number/index.html

33 lines
945 B
HTML
Raw Normal View History

2022-06-23 05:58:54 +00:00
{% set meta={"title": "Number", "desc": "make go up"} %}
{% extends "/_base.html"%}
{% block head%}
<script>
window.onload = () => {
var xhr = new XMLHttpRequest();
xhr.open("GET", "https://api.trimill.xyz/number");
xhr.send();
xhr.onload = () => {
document.getElementById("number").innerHTML = xhr.responseText;
}
xhr.onerror = () => {
document.getElementById("number").innerHTML = "Error loading number."
}
}
function makegoup() {
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://api.trimill.xyz/number");
xhr.send();
xhr.onload = () => {
document.getElementById("number").innerHTML = xhr.responseText;
}
}
</script>
{% endblock %}
{% block content%}
<div id="number">?</div>
<div>
<input type="button" value="Make go up" id="button" onclick="makegoup();" />
</div>
{% endblock %}