views:

23

answers:

1

Hi ,

In my jquery snippet, am using the function(e) and also in some places i used function(event)

How system really understand the e is the event object,

is any where they declared by default ,

+2  A: 

It doesn't matter what you call the event object (as long as it's not a keyword), it's whatever the first parameter is, you're just giving it an identifier.

For example, you could call it wakyThing and it'd still work...it's still the first argument passed to the handler. This is the same for all jQuery handlers, from the docs:

The event object is guaranteed to be passed to the event handler.

Nick Craver