Detecting if jQuery is already has a running instance
<p>I'm making a script which requires jQuery X version. Let's say 1.7.1.</p>

<p>Script will be included into other systems like include('script-main.php'); as a plugin. I will just tell my customers to copy/paste it, because I have no direct access to their servers. It will be on sale on a website like eBay.</p>

<p>I need to know if they already loaded jQuery 1.4 in header, or another version.</p>

<p>So, how can I do a check like this? (in pseudo code)</p>

<pre><code>if(jQuery-&gt;isLoaded())
{
     if(jQuery-&gt;getVersion() &gt; 1.7)
     {
         //do my task
     }
     else
     {
         //include 1.7 but don't mess up already installed 1.4!
         //If they already have some jQuery coded in that page, it shouldn't break them - neither touch
     }
}
else
{
     jQuery-&gt;load(); //load 1.7.1 via googleapis
}
</code></pre>
