Dokument jQuery gotowy
// jQuery document ready
$(document).ready(function() {
});
Ugly Unicorn
// jQuery document ready
$(document).ready(function() {
});
// A $( document ).ready() block.
$( document ).ready(function() {
console.log( "ready!" );
});
document.addEventListener("DOMContentLoaded", function() {
// code
});
document.addEventListener("DOMContentLoaded", function(event) {
//do work
});
// A document ready block with JQery.
$( document ).ready(function() {
// we ready for fire action with JQery.
});
// A document ready block with javascript.
document.addEventListener("DOMContentLoaded", function(event) {
// we ready for fire action with javascript.
});
function docReady(fn) {
// see if DOM is already available
if (document.readyState === "complete" || document.readyState === "interactive") {
// call on next available tick
setTimeout(fn, 1);
} else {
document.addEventListener("DOMContentLoaded", fn);
}
}