The difference is about scope, meaning what variables are visible where, but that's a general javascript question and is outside the scope of this group. (No pun intended) :-)
-- Marcelo - http://maps.forum.nu -- On Sep 2, 5:24 pm, "d...@mausner" <[email protected]> wrote: > Mappers, every published code sample uses a closure as the > GEvent.addListener callback. There seem to be multiple ways. Do they > have different side effects? > > 1. addListener(x, y, function (z) { code }); > 2. function A(z) {code}; addListener(x, y, A); > 3. function A(z) {code}; addListener(x, y, function (z) { A(z) }); > > Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" 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-API?hl=en -~----------~----~----~----~------~----~------~--~---
