извикване на функция при зареждане на jquery
$(document).ready(function () {
// Function code here.
});
събитие на jquery onload
// A $( document ).ready() block.
$( document ).ready(function() {
console.log( "ready!" );
});
проверете, натоварени ли jquery
$(document).ready(function(){
if (jQuery) {
// jQuery is loaded
alert("Yeah!");
} else {
// jQuery is not loaded
alert("Doesn't Work");
}
});
javascript, ако заредена с jquery
window.onload = function() {
if (window.jQuery) {
// jQuery is loaded
alert("Yeah!");
} else {
// jQuery is not loaded
alert("Doesn't Work");
}
}