Hotfix: ShortenLink & feedbackForm JS
This commit is contained in:
parent
06d0d9c136
commit
b93971f90f
@ -1,16 +1,16 @@
|
||||
$(function () {
|
||||
$('#formLinkShortener').submit((event) => {
|
||||
event.preventDefault();
|
||||
const postdata = $('#formLinkShortener').serialize();
|
||||
$('#feedbackForm').submit((e) => {
|
||||
e.preventDefault();
|
||||
const postdata = $('#feedbackForm').serialize();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '../../php/shortenLink.php',
|
||||
url: '../../php/feedbackForm.php',
|
||||
data: postdata,
|
||||
success: (text) => {
|
||||
try {
|
||||
$(".results").html(JSON.parse(text).message);
|
||||
} catch (error) {
|
||||
$(".results").html("URL invalide.");
|
||||
success: (response) => {
|
||||
const result = JSON.parse(response);
|
||||
$(".results").html(result.message);
|
||||
if(result.isSuccess) {
|
||||
$("#feedbackForm")[0].reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -14,6 +14,7 @@ $(function () {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Affiche l'input selon le choix de l'utilisateur sur la page linkShortener
|
||||
$('.hideUserShortcut').hide();
|
||||
@ -24,5 +25,4 @@ $(function () {
|
||||
$('.hideUserShortcut').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user