title: Include a jquery library if it doesnt exist
body: <p>I have 5000 JSP pages in my application in which 2500 pages have jquery library included in them. So still I have 2500 JSP which doesn't have it I cannot add manually in all those files I want a piece of code either in JavaScript or java which should check whether src="jquery/jquery-generic.js" this already exists or not.If not then I need to add it. </p>
  
  <p>I have some functions which are included in all JSP pages so I have added this script code from that function but it is breaking my system because in some pages I have these functions after all the libraries are included. so there are some features which are depended on my jquery so I code I wrote is overriding the code which already existing and when the other libraries which are depended on that are not working. </p>
  
  <p>ex:</p>
  
  <pre><code>&lt;script type="text/javascript" src="jquery/jquery-generic.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jquery/hoverIntent.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" media="screen" href="css/superfish.css"&gt;
  &lt;link rel="stylesheet" media="screen" href="css/superfish-vertical.css"&gt;
  &lt;link type="text/css" href="jquery/jquery-ui.css" rel="stylesheet" /&gt;
  &lt;script type="text/javascript" src="jquery/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jquery/jquery.blockUI.js"&gt;&lt;/script&gt;
  ................................
  .................................
  at some point my functions are adding the the library again
  &lt;script type="text/javascript" src="jquery/jquery-generic.js"&gt;&lt;/script&gt;
  so all the above functions are not working.
  </code></pre>
  
  <p>can anyone have an idea how to check whether already code exists or not if not add it?</p>