hi forum members!

i'm just starting with javascript, i need some basic advice please.

i started reading "simply javascript" - and i'm enjoying it. at around page 135, the book discusses "The Problem with Event Handlers" - and i don't really get the problem.

it shows a sample code, trying to have two functions fire for an element's "onclick" event handler, as such:

element.onclick = function()
{
script1.clickHandler();
script2.clickHandler();
}



...and then states that this is bad for the 3 following reasons:

But all sorts of things are wrong with this approach:
1) "this" will no longer point to the element within the clickHandler methods.
2) If either clickHandler method returns false, it will not cancel the default actionfor the event.
3) Instead of assigning event handlers neatly inside a script’s init method, you
have to perform these assignments in a separate script, since you have to reference both script1 and script2.



so....here's what i don't understand:

what is wrong with doing it this way:

var myLink =
{
init: function()
{
var link = document.getElementById("myLinksID");
link.onclick = myLink.clickHandler;
},

clickHandler: function()
{
Script1(this);
Script2(this);
return false;
}
};
.
.
.
Script1 = function(that)
{ alert(that.href); } //alerts original "this" link href

Script2 = function(that)
{ alert(that.href); } //alerts original "this" link href
.
.
.



...and so, i'm not sure - but it appears to the untrained mind that their issues are addressed, such as:

1) "this" is passed to next function, which eliminates their first issue.
2) the "false" is returned at the end of the single function eliminates the 2nd issue
3) i tried this code and it seems to work ok...so i'm not sure on #3, but i seem to be assigning the handler in the init phase...


and so now - before i get thoroughly crushed by everyone - i do realize that the book is obviously correct, i just don't get why. i am trying understand the reasoning behind these concepts - and this is the only way i know how to ask, by showing my incorrect thoughts and having the concept explained back to me that way.

thanks a lot for anyone's kind advice here, i'm looking forward to the lights coming "on" here - thanks
/tre