title: How do I use function argument to find exact clicked marker in google maps?
body: <p>My marker will always displays the last info on click of it. Basically I want to display the corresponding info for each of the clicked markers. here is what I have so far:</p>
  
  <pre><code>$(function() {
      var map = new google.maps.Map(document.getElementById('map_canvas'), {
                  zoom : 2,
                  center: new google.maps.LatLng(43.65654, -79.90138),
                  mapTypeControl: false, //will remove the top right corner Map type(Satellite/Map)
                  //scaleControl: false,
                  navigationControl: false,
                  mapTypeId: google.maps.MapTypeId.ROADMAP
                  });
              $.get('example.xml', function(xml) {
              $('marker',xml).each(function(i) {
                  var $this = $(this),
                      the_marker = new google.maps.Marker({
                          title: $this.find('label').text(),
                          map: map,
                          clickable: true,
                          position: new google.maps.LatLng(
                              parseFloat($this.find('lat').text()),
                              parseFloat($this.find('lon').text())
                      )});
                          new google.maps.event.addListener(the_marker, 'click', function() {
                          getInfo();
                  });
              }); 
          });
      function getInfo() {
              $.ajax({
                  type:'GET',
                  url:'example.xml',
                  dataType:'xml',
                  success: function(xml) {
                  $(xml).each(function() {
                      $(this).find("marker").each(function() {
                          $(this).find("info"); 
                          $("#newDiv").html($(this).find("info"));
                      })
                  })
                  }
  
              })
          $("#newDiv").html($(this).find("info").text());
      }
      });
  </code></pre>
  
  <p>It is like I am getting always the last infowindow on click of my markers, but rather i want the each marker to have its own infowindow open. Now I dont have infowindow's in my example and i have divs in it.</p>
  
  <p>Thanks</p>