1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Rep Power

    Strange parameter in PHP listener initializer?

    Looking for an exemple for how to use the google map api, i found this strings

    google.maps.event.addListener(marker, 'click', (function(marker, i) {
    return function() {
    infoWindow.open(map, marker);
    })(marker, i));

    I don't undertsand what means those (marker, i) placed on the end... It seems a parameter passed to addListener method placed after the anonymous function initializer.. I never seen a thing of genre, can you explain me? thanks
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Rep Power
    You might want to check out the documentation; that goes along with the Google Maps JavaScript API, so that you may better understand what is going on with your code example; you can find the documentation here:https://developers.google.com/maps/d...ascript/events.

IMN logo majestic logo threadwatch logo seochat tools logo