check whether jquery is already defined or not
<p>Hi i am trying to create a plugin for my client, i will just add the following code in their html.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;script type="text/javascript"&gt;
    var clientID = "123";

    (function() {
        var test = document.createElement('script'); test.type = 'text/javascript'; test.async = true;
        test.src = 'myjavascript.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(test, s);
    })();
    &lt;/script&gt;

    &lt;div id="addimage"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>And in myjavascript.js file i will call the jquery library.</p>

<pre><code>if (typeof jQuery === "undefined") {
    var script = document.createElement('script');
    script.src = 'http://mysite.com/js/jquery-1.7.1.min.js';
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script);
}


if (typeof jQuery === "undefined") {
    var script = document.createElement('script');
    script.src = 'http://mysite.com/js/fancybox.js';
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script);
}

// my rest code goes here
</code></pre>

<p>So i would like to check whether the client html already has to call for jquery-1.7.1.min.js if not, then only include the 1.7.1.min.js file in myquery.js</p>

<p>How to check whether its already included or not. Please help!</p>
