Skip to content

Instantly share code, notes, and snippets.

@miguelzetina
Created November 7, 2019 16:02
Show Gist options
  • Save miguelzetina/f34a15106003aa35f634a28cde85a070 to your computer and use it in GitHub Desktop.
Save miguelzetina/f34a15106003aa35f634a28cde85a070 to your computer and use it in GitHub Desktop.
$("#form-password").submit((e)=>{
e.preventDefault();
$.ajax({
type: "POST",
url: "/api/parent/new-password",
data: JSON.stringify({token: $.url("?token"), password: $("#form-password input[name=password]").val()}),
contentType: "application/json",
success:function() {
location.replace('password-successful.html');
},
error:function() {
location.replace('password-error.html');
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment