When adding a listener why does the third element of the argument,
which is always a handler function, have to be named as a function
every time as in:
google.maps.event.addListener(map, 'click', function() {
alert("hello")
});
Why can’t you just assume it’s a function and use the more compact?
google.maps.event.addListener(map, 'click', alert("hello"));
After all we know that the second element is an event but we don't
have to write event: 'click', just 'click'
Just curious, Steve.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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/google-maps-js-api-v3?hl=en.