ok-tools
Version:
My personal JS tools and utilities
19 lines • 603 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.$ = exports.onReady = void 0;
function onReady(fn) {
if (typeof fn === 'string') {
console.warn('This is not jQuery! Use $() function only for adding callbacks that should fire on page initialisation. ' +
'Use $$() to search for an element.');
return;
}
if (document.readyState === 'complete') {
fn();
}
else {
document.addEventListener('DOMContentLoaded', fn);
}
}
exports.onReady = onReady;
exports.$ = onReady;
//# sourceMappingURL=on-ready.js.map