title: Is there a way to get the name of the caller function within the callee?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/280389/javascript-how-do-you-find-the-caller-function">Javascript how do you find the caller function?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm experimenting with javascript/jQuery a bit this morning and was trying to capture the caller name of the currently executing function.</p>
  
  <p>So in the below example, the log would show <code>runMe</code> as the caller and <code>showMe</code> as the callee.</p>
  
  <pre><code>jQuery(document).ready(function($) {
  
    function showMe() {
      // should log the runMe as the caller and showMe as callee
      console.log('Callee: ',arguments.callee)
      console.log('Caller: ',arguments.caller);
    }
  
    function runMe() {
      // getting executed as a button is pressed.
      showMe();
    }
  
    $('a').bind('click', function(e) {
      e.preventDefault();
      runMe();
    });
  
  });
  </code></pre>
  
  <p>The above obviously doesn't work, hence my question to you all. </p>
  
  <p>Is there a good way to get the caller in the above example?</p>
  
  <p><em>please note: I am aware I could get the callee of <code>runMe</code> and pass it into <code>showMe</code> as an argument but this question is aiming towards a solution that does not require the caller to be passed into the function 'manually'.</em></p>
  
  <p>Are there reasons against doing something like this?</p>