21 lines
No EOL
469 B
JavaScript
21 lines
No EOL
469 B
JavaScript
const url = 'https://exozy.me/new/'
|
|
const form = document.querySelector('form')
|
|
|
|
form.addEventListener('submit', (e) => {
|
|
e.preventDefault()
|
|
|
|
const data = new Object()
|
|
|
|
for (const s of ['firstname', 'lastname', 'email', 'username', 'password']) {
|
|
data[s] = document.getElementsByName(s)[0].value
|
|
}
|
|
|
|
console.log(data)
|
|
|
|
fetch(url, {
|
|
method: 'POST',
|
|
body: JSON.stringify(data),
|
|
}).then((response) => {
|
|
alert(response.statusText)
|
|
})
|
|
}) |