Dzień dobry!
Jak przekształcić poniższy kod na vanilla js?
jQuery(document).ready( function($) {
// Listen for the custom event "heartbeat-tick" on $(document). This fire's once every minute that the page is open.
$(document).on( 'heartbeat-tick', function(e, data) {
console.log('OK');
});
});
Próbowałem czegoś takiego ale niestety nie działa
window.addEventListener("DOMContentLoaded", function(event) {
"use strict";
document.addEventListener('heartbeat-tick', function() {
console.log('OK');
});
});