title: Loading javascript file after click event
body: <p>I am trying to load a rich text plugin (NicEdit) AFTER a click event. The plugin has two parts to it: </p>
  
  <pre><code>&lt;script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;bkLib.onDomLoaded(nicEditors.allTextAreas);&lt;/script&gt;
  </code></pre>
  
  <p>When I try to load the files before the click event as follows, it works</p>
  
  <pre><code>$(document).ready(function() {
      $.getScript('http://js.nicedit.com/nicEdit-latest.js', function(jd) {
        // Call custom function defined in script
            bkLib.onDomLoaded(function() { nicEditors.allTextAreas()
          });
       $("a").click(function(event));
      });
  });
  </code></pre>
  
  <p>However, I need it to load AFTER the click event so it is also applied to the innerHTML page I load.</p>
  
  <p>EDIT </p>
  
  <pre><code>$(document).ready(function() {    
      $('a').on('click', function(ev) {
          ev.preventDefault();
          var url = $(this).attr('href');
          $.getScript("https://s3.amazonaws.com/RichText-javascript/nicEdit.js",function(){
          $('.answers').load(url);
       });//getscript ends
     });//click handler ends
  });//doc ready ends
  </code></pre>
  
  <p>What am I doing wrong?</p>