how to know if jquery is loaded code example
Example 1: check if jquery is loaded
$(document).ready(function(){
if (jQuery) {
alert("Yeah!");
} else {
alert("Doesn't Work");
}
});
Example 2: check if jquery is installed
if (typeof jQuery == "undefined") {
alert("JQuery is not installed");
} else {
alert("JQuery is installed correctly!");
}
Example 3: test if jquery works
window.onload = function() {
if (window.jQuery) {
console.log("jQuery has loaded!");
} else {
console.log("jQuery has not loaded!");
}
}
Example 4: how to check if jquery is loaded
window.onload = function() {
if (window.jQuery) {
alert("Yeah!");
} else {
alert("Doesn't Work");
}
}