add a lot of new stuff

This commit is contained in:
fyr77 2020-12-07 15:57:57 +01:00
parent 8acfe0e85a
commit 9e3e0ffe39
9 changed files with 792 additions and 71 deletions

33
api/index.html Normal file
View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title>test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<textarea id="testa"></textarea>
<textarea id="func"></textarea>
<textarea id="instr"></textarea>
<script>
function doReq() {
const instr = document.getElementById("instr").value.replace(/\+/g, "%2B"); //necessary for encoding
const options = {
method: 'POST',
body: `func=${document.getElementById("func").value}&instr=${instr}`,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
console.log(options.body);
fetch('https://dev.jakobsenkl.pw/hohoho/api.php', options)
.then(res => res.text())
.then(res => (document.getElementById("testa").value = res))
.catch(err => console.error(err));
}
</script>
</body>
</html>