I have a test.html which includes tree.js.
in this HTML I have
<div id='forObj'></div>
<script type='text/javascript'>
var obj = new Tree(document.getElementById('forObj');
</script>
Inside the Tree.js File I have a function called
this.draw
...
else
{
div.onclick = function(){obj.eventFoo(this.id);};
}
...
my Problem is: Now everyone has to refer to the Object obj, or this will not work.
How can I generalize it, so the Object can get every name the coder wants to use?