On Mar 20, 2006, at 3:53 PM, Karl Guertin wrote:
>
> On 3/20/06, LukeStark <[EMAIL PROTECTED]> wrote:
>> Perhaps I'm not being clear. Is the following, in fact, the correct
>> way to create a link that calls a function (fiddlyBits) on
>> otherObject?
>
> Thomas is saying that doing connect on a ton of elements is
> inefficient. He suggests you do :
>
> pageInit = function(){
> connect
> (document.documentElement,"onclick",otherObject,"fiddlyBitsDispatch");
> }
>
> And then having fiddlyBitsDispatch do some tests to figure out where
> the event should go. The dispatch will get all the clicks on the
> entire page.
>
> To be honest, I generally use onclick for this scenario. People have a
> tendency to click before the page finishes loading and I don't like my
> interaction breaking arbitrarily.
Practicality can definitely beat purity in cases like this where
browsers just aren't up to snuff. That said, you can certainly
register a global onclick handler on the document before much of
anything is in the DOM yet, which would serve the same scenario
(click before load completion).
-bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---