This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/scripts/execute-function/feedbackForm_DOM.js

18 lines
447 B
JavaScript
Raw Normal View History

$(function () {
$('#formLinkShortener').submit((event) => {
event.preventDefault();
const postdata = $('#formLinkShortener').serialize();
$.ajax({
type: 'POST',
url: '../../php/shortenLink.php',
data: postdata,
success: (text) => {
try {
$(".results").html(JSON.parse(text).message);
} catch (error) {
$(".results").html("URL invalide.");
}
}
});
});
});