
FetchIt
Lightweight component for form handling and submission using Fetch API


This example shows how to integrate PNotify.
<!-- JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/@pnotify/core@5/dist/PNotify.min.js" defer></script>
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5/dist/PNotify.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@pnotify/core@5/dist/BrightTheme.min.css" rel="stylesheet">FetchIt.Message as follows:document.addEventListener('DOMContentLoaded', () => {
FetchIt.Message = {
success(message) {
PNotify.success({ title: message });
},
error(message) {
PNotify.error({ title: message });
},
}
});defer attribute; then you do not need the DOMContentLoaded handler and have direct access to the FetchIt class:FetchIt.Message = {
success(message) {
PNotify.success({ title: message });
},
error(message) {
PNotify.error({ title: message });
},
}Done! With these steps you integrate PNotify.