
FetchIt
Lightweight component for form handling and submission using Fetch API


toastr is a library for displaying non-blocking notifications; this example shows how to integrate it.
Warning!
Note that toastr and Bootstrap framework selectors may conflict.
<!-- jQuery -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" defer></script>
<!-- Javascript -->
<script src="https://cdn.jsdelivr.net/npm/toastr@2/build/toastr.min.js" defer></script>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastr@2/build/toastr.min.css">FetchIt.Message property as follows:document.addEventListener('DOMContentLoaded', () => {
FetchIt.Message = {
success(message) {
toastr.success(message);
},
error(message) {
toastr.error(message);
},
}
});defer attribute; then you do not need to wrap the handler in DOMContentLoaded and get direct access to the FetchIt class:FetchIt.Message = {
success(message) {
toastr.success(message);
},
error(message) {
toastr.error(message);
},
}That's it! We do not recommend using this library in your project if you do not already have jQuery. Connecting an entire other library just for notifications is excessive.