title: Insert JavaScript function (as string) into Html and call it
body: <p>I want to inject a <code>JavaScript</code> function into <code>DOM</code> and call it at a later time.</p>
  
  <p><em>Something like this</em></p>
  
  <pre><code>var funcCode = 'function test() { alert("test"); }';
  
  function callFunc(functionName){
      functionName();
  }
  
  callFunc('test');
  </code></pre>
  
  <p>How can I do this?</p>
  
  <p><strong>Update</strong></p>
  
  <p><em>Contextual problem</em></p>
  
  <p>I have actions and <code>function</code> in the database.
  <code>Functions</code> are based on actions.
  I retrieve both actions and <code>functions</code>, and show actions on <code>UI</code> but I need to inject the <code>JS</code> function for each action shown. If an action is dismissed so the function should be.</p>
  
  <p><code>DOM</code> functions needed</p>
  
  <pre><code>var name1 = function () {
  
      return {
          run : function() {
              // code for action 1                
          }
      }
  } 
  
  var name2 = function () {
  
      return {
          run : function() {
              // code for action 2                
          }
      }
  }
  ...
  </code></pre>
  
  <p>Manager for actions (and want something like this)</p>
  
  <pre><code>Manager.Use(funcName) =&gt; to call run
  </code></pre>