
FetchIt
Lightweight component for form handling and submission using Fetch API


This section shows how to integrate the Notiflix library (pure JavaScript) and its Notify tool.
FetchIt.Message as follows:<script type="module">
import Notiflix from 'https://cdn.jsdelivr.net/npm/notiflix@3/+esm';
document.addEventListener('DOMContentLoaded', () => {
FetchIt.Message = {
success(message) {
Notiflix.Notify.success(message);
},
error(message) {
Notiflix.Notify.failure(message);
},
}
});
</script>defer attribute; then you do not need the DOMContentLoaded handler and have direct access to the FetchIt class:import Notiflix from 'https://cdn.jsdelivr.net/npm/notiflix@3/+esm';
FetchIt.Message = {
success(message) {
Notiflix.Notify.success(message);
},
error(message) {
Notiflix.Notify.failure(message);
},
}Done! With these steps we integrate Notiflix.Notify.