Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkNickname() {
- let nickname = document.getElementById("nickname").value;
- let resp;
- fetch("http://edi.iem.pw.edu.pl/chaberb/register/check/" + nickname, {
- mode: "no-cors",
- headers: {
- "Content-Type": "application/json"
- },
- })
- .then(function (response) {
- resp = response
- })
- .catch(function (response) {
- console.log(response)
- });
- if ( resp ) {
- document.getElementById("nicknameCheckResponse").innerHTML = "Nickname too awesome and is already taken"
- }
- }
- function sendForm() {
- fetch('http://edi.iem.pw.edu.pl/chaberb/register/user/', {
- method: 'POST',
- body: document.getElementById("form")
- }).then(function (response) {
- console.log(response)
- })
- .catch(function (response) {
- console.log(response)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement