> Okay, I get that so far, but what is the name of the event that is
> automatically passed as the first parameter?
It's totally up to you -- you're the one defining the function that's
getting called, you define the names of its parameters. You can call
it flapjack if you like. :) In his first reply to you, Elden called it
"event" -- here's the code he posted, with ===>markers<=== in both of
the relevant places:
function blah(===>event<===){
//this function would do way more than this
===>event<===.stop();
alert ("blah");
}
Since he called it "event" in the function signature, that's the name
he used in the code; but this would also work:
function blah(flapjack){
//this function would do way more than this
flapjack.stop();
alert ("blah");
}
Hope this helps,
--
T.J. Crowder
tj / crowder software / com
On Mar 7, 3:08 pm, Walter Lee Davis <[EMAIL PROTECTED]> wrote:
> Okay, I get that so far, but what is the name of the event that is
> automatically passed as the first parameter? One of the other posters
> suggested I use event.stop(), but that just got me an error as event
> was not defined.
>
> Walter
>
> On Mar 7, 2008, at 9:58 AM, T.J. Crowder wrote:
>
>
>
> > Unless you really want "this" to reference a string object within your
> > handler, you won't want to pass strings into bindAsEventListener as
> > far as I can see.
>
> > The first parameter to bindAsEventListener is the object that you want
> > to access via "this" within the handler (http://www.prototypejs.org/
> > api/function/bind,http://www.prototypejs.org/api/function/
> > bindAsEventListener).
> > When the handler is called in response to an event, the first argument
> > to it will be the event object for the event. These are two separate
> > things.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---