The site contains movies data.
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.

55 lines
1.4 KiB

4 years ago
$(document).ready(function(){
$('.message a').click(function(){
$('form').animate({height: "toggle", opacity: "toggle"},"slow");
})
});
async function submitForm(e, form){
e.preventDefault();
try {
const response = await fetch('https://mkr.thefeathers.in/register', {
method: 'post',
body: JSON.stringify({
"username": form.formName.value,
"email": form.formEmail.value,
"password": form.formPassword.value,
})
});
const data = await response.json();
//Success code goes here
//window.location = "searchmovies.html";
alert(JSON.stringify(data));
$('form').animate({ height: "toggle", opacity: "toggle" }, "slow");
}
catch (err) {
//Failure
alert('Error');
}
}
async function submitForm1(e, form){
e.preventDefault();
try {
const response = await fetch('https://mkr.thefeathers.in/login', {
method: 'POST',
body: JSON.stringify({
"username" : document.getElementById('formName1').value,
"password" : document.getElementById('formPassword1').value
})
});
const data1 = await response.json();
//Success code goes here
alert(JSON.stringify(data1));
window.location = "searchmovies.html";
}
catch (err) {
//Failure
alert('Error');
}
}