point-median-frontend/static/script.js

25 lines
751 B
JavaScript
Raw Normal View History

2024-12-31 03:36:06 +00:00
$(document).ready(function() {
$('#correct-button').click(function() {
var text = $('#input-text').val();
$.ajax({
url: '/correct',
method: 'POST',
data: { text: text },
success: function(response) {
if (response.error) {
alert(response.error);
} else {
$('#output-text').val(response.text);
}
},
error: function() {
alert('Une erreur est survenue lors de la correction du texte.');
}
});
});
// Load email form
$.get('ressources/formulaire_courriel.html', function(data) {
$('#email-form').html(data);
});
});