Get running object name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lagon666
    New Member
    • Jun 2009
    • 22

    Get running object name

    Get running object name

    Hi
    Is it possible to get running object name using a command that defined in same object?


    Code:
    <script>
    var test = function()
    {
    	this.find = function()
    	{
    			alert('How can i know that this object is running as "a" variable?');
    	}
    }
    </script>
    
    <script>
    var a = new test();
    a.find(); // Need solution for returning "a"
    </script>
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I think it’s this.callee. search for inheritance, it should be mentioned there.

    Comment

    Working...