function updateAccount(user_id) { var email = document.getElementById("email").value; $.ajax({ type: "POST", url: "php/account/update_account.php", data: { user_id: user_id, email: email }, success: function (res) { if (res === 'error') { ErrorAlert("Errore: "+res); } else { SuccessAlert('Account aggiornato'); location.reload(); } } }); }