Skip to content
Advertisement

Checking if jquery is loaded using Javascript

I am attempting to check if my Jquery Library is loaded onto my HTML page. I am checking to see if it works, but something is not right. Here is what I have:

JavaScript

Advertisement

Answer

something is not right

Well, you are using jQuery to check for the presence of jQuery. If jQuery isn’t loaded then $() won’t even run at all and your callback won’t execute, unless you’re using another library and that library happens to share the same $() syntax.

Remove your $(document).ready() (use something like window.onload instead):

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement