title: Creating javascript hooks possible?
body: <p>Is it possible to create a hook system in javascript as like as php ?</p>
  
  <p>for an example ---- </p>
  
  <pre><code>function myjsfunction(){
  
      call_my_function('handle_name');
  
  }
  </code></pre>
  
  <p>now whatever function people add with 'handle' name it should get executed there.</p>
  
  <p>like </p>
  
  <pre><code>add_to_function('handle_name', function(){alert('hi')});
  add_to_function('handle_name', function(){alert('hello')});
  </code></pre>
  
  <p>both these functions should execute</p>