title: how to load external javascript inside partial view dynamically?
body: <p>I'm using jquery's .html() function to inject a html file into a partial div of the main page of my application. In the injected partial html page, there is a javascript reference such as script(src='../../javascripts/partialFunctions.js'). 
  The jquery function and the main page are like:</p>
  
  <pre><code>$('.partialDiv').html(htmlResult);
  
  &lt;div&gt;main page&lt;/div&gt;
  &lt;div class='partialDiv'&gt;&lt;/div&gt;
  &lt;input type='button'&gt;button&lt;/input&gt;
  </code></pre>
  
  <p>When the user click a specific button on the main application page, the jquery function will got called and the html file will got injected to the main page. </p>
  
  <p>The problem is every time a new htm file got injected, the browser will load the script file. So there will be many duplicated javascript functions after the user clicked the button several times. </p>
  
  <p>How can I do this dynamically and avoid the duplication of javascript functions? </p>
  
  <p>Thanks in advance!</p>