
FetchIt
Lightweight component for form handling and submission using Fetch API


This section helps you integrate the minimal Notie module for notifications, input and selection on JavaScript. Let's integrate it.
<!-- JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/notie@4/dist/notie.min.js" defer></script>
<!-- CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/notie@4/dist/notie.min.css">FetchIt.Message as follows:document.addEventListener('DOMContentLoaded', () => {
FetchIt.Message = {
success(message) {
notie.alert({
type: 'success',
text: message,
});
},
error(message) {
notie.alert({
type: 'error',
text: message,
});
},
}
});defer attribute; then you do not need the DOMContentLoaded handler and have direct access to the FetchIt class:FetchIt.Message = {
success(message) {
notie.alert({
type: 'success',
text: message,
});
},
error(message) {
notie.alert({
type: 'error',
text: message,
});
},
}Done! With these steps you integrate the Notie module.