
FetchIt
Lightweight component for form handling and submission using Fetch API


This section describes how to integrate the NOTY notification library.
Warning!
At this time the NOTY library is not maintained by its author and is marked DEPRECATED.
<!-- JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/noty@3.2.0-beta-deprecated/lib/noty.min.js" defer></script>
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/noty@3.2.0-beta-deprecated/lib/noty.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/noty@3.2.0-beta-deprecated/lib/themes/mint.min.css" rel="stylesheet">FetchIt.Message as follows:document.addEventListener('DOMContentLoaded', () => {
FetchIt.Message = {
success(message) {
new Noty({
type: 'success',
text: message
}).show()
},
error(message) {
new Noty({
type: 'error',
text: message
}).show()
},
}
});defer attribute; then you do not need the DOMContentLoaded handler and have direct access to the FetchIt class:FetchIt.Message = {
success(message) {
new Noty({
type: 'success',
text: message
}).show()
},
error(message) {
new Noty({
type: 'error',
text: message
}).show()
},
}Done! With these steps you integrate NOTY.