This is a simple jQuery function wrapper used at HiveTek and Trinary.
You can load the script from the CDN.
<script src="//cdn.jsdelivr.net/gh/milhouse1337/hivetek-js/dist/hivetek.min.js"></script>
There are a few basic functions you can use.
<script>
$(document).ready(function() {
$.hivetek.loadTokenFromMeta(); // Add `X-CSRF-TOKEN` header on all AJAX requests.
$.hivetek.loadLegacy(); // Inject some functions on the `window` object.
$.hivetek.config('fadein_delay', 200); // Update fadeIn animation delay.
$.hivetek.config('text_loading', 'Loading...'); // Update the loading text.
});
</script>
// Simple GET request.
$.hivetek.doAjaxGet('/example', {'foo': 'bar'}, function(data) {
// console.log(data);
}, function(error) {
// console.log(error);
});
// Simple POST request.
$.hivetek.doAjaxPost('/example', {'foo': 'bar'}, function(data) {
// console.log(data);
}, function(error) {
// console.log(error);
});
$.hivetek.doAjaxFancybox('/example', {'foo': 'bar'}, false); // Open modal.
$.hivetek.closeModal(); // Close modal.
$.hivetek.doAjaxModal('/example', {'foo': 'bar'}, false); // Open modal.
$.hivetek.closeModal(); // Close modal.
npm install
npx gulp
The MIT License (MIT). Please see License File for more information.