You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Web/Sources/public/js/preference.js

15 lines
465 B

document.getElementById('saveButton').addEventListener('click', function() {
var preferences = {
notifications: document.getElementById('notif').checked,
theme: document.getElementById('theme').value
};
fetch('/index.php/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(preferences),
})
.catch((error) => console.error('Error:', error));
});