I use a function to check if jQuery exist or not in my website! Well, the first lines are :
if (typeof jQuery == 'undefined') {
// it doesnt exist. I load it
} else {
console.log($);
$(document).ready(function() {
startMyFunction();
});
};
the problem is that, when I load the page, jQuery is not undefined, so it go directly to the else statment (I see the console.log message).
But, seems that I can’t use it. console.log($) print undefined, and I get $ is not a function when the $(document).ready is called.
How is possible?
If
jQueryexists but not$, you have probably loaded jQuery innoconflictsmode.