title: Javascript literal object execute method in another literal object
body: <p>Well I'm no JS expert, but...I have 3 literal javascript objects:</p>
  
  <p>1 Main search object and other 2 objects who work with that object and ask
  for data.</p>
  
  <p>The thing is - that I need to render the results differently so I set a different callbacks
  inside each requesting object but I cant get the search object to trigger it.</p>
  
  <p>Any ideas?</p>
  
  <pre><code>var Search = {
  
      Execute: function() {
      // logic
  
      // Set the result/data
      var $someObjectHere
  
      // Execute Callback
      if ( theCallback.indexOf('.') != -1 ) {
          // Its a method inside an object, trigger it.
          theCallback = theCallback.split('.');
          obj = theCallback[0];
          methodName = theCallback[1];
          obj[methodName]($someObject); &lt;--- DOESNT WORK!
          }
      }
  }
  
  var Obj1 = {
  
      bind_events: function() {
          $('button1').on('click',function(){
              Search.theCallback = 'obj1.mycallback';
              Search.Execute();
          });
      },
  
      mycallback: function() {
          // CALLBACK!
      }
  }
  
  var Obj2 = {
  
      bind_events: function() {
          $('button1').on('click',function(){
              Search.theCallback = 'obj2.mycallback';
              Search.Execute();
          });
      },
  
      mycallback: function() {
          // CALLBACK!
      }
  }
  </code></pre>