Check if jquery library exist

How to check if jQuery library exist in head tags?

<head>
<script type="javascript/text" src="http://code.jquery.com/jquery-1.6.2.js"></script>
</head>

and if not exist how do I load in head tags the jquery library, I’m doing a plugins and I want to load my plugins script in jQuery and also do able to check if jQuery library exist so my jQuery script will run

4 Answers
4

scripts and styles should never be embedded directly in themes or templates because of potential conflicts between plugins and themes.

To use jQuery in a plugin or theme it should be enqueued with wp enqueue script. This will make sure it’s added only once, and any scripts that define it as a dependency will load after.

Leave a Comment