I have this code in a global JS file.
$(document).ready(function() {
DoStuff();
});
Unfortunately there are pages that include this file but doesn’t include the jquery file. So I get errors:
Message: The value of the property '$' is null or undefined,
not a Function object
How do I run document.ready() only if JQuery file is loaded.
UPDATE
Check for
window.jQueryinstead of justjQuery. This should circumvent the “not defined” error.