Q:

Add a share button in google map comment

I have a Jscript which using HTML5 geoloaction,
It works perfectly. i want to add a share button where it shows my position, But i cant find how i can add a button here
 <script src="https://maps.googleapis.com/maps/api/js?secretapi&sensor=true"></script>
    <script>
var map;

function initialize() {
  var mapOptions = {
    zoom: 18,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
      mapOptions);

  // Try HTML5 geolocation
  if(navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {
      var pos = new google.maps.LatLng(position.coords.latitude,
                                       position.coords.longitude);

      var infowindow = new google.maps.InfoWindow({
        map: map,
        position: pos,
        content: 'your pos' +pos //**i want add a fb share button here**
      });

      map.setCenter(pos);
    }, function() {
      handleNoGeolocation(true);
    });
  } else {
    // Browser doesn't support Geolocation
    handleNoGeolocation(false);
  }
}

function handleNoGeolocation(errorFlag) {
  if (errorFlag) {
    var content = 'Error: The Geolocation service failed.';
  } else {
    var content = 'Error: Your browser doesn\'t support geolocation.';
  }

  var options = {
    map: map,
    position: new google.maps.LatLng(60, 105),
    content: content
  };

  var infowindow = new google.maps.InfoWindow(options);
  map.setCenter(options.position);
}

google.maps.event.addDomListener(window, 'load', initialize);

    </script>

A:

Infowindow can have html markup as content. So if you want to add a button you can simply 
do 
content: 'your pos' + pos + '<button></button>'

Consider it as a div that can take any html markup, which can be styled too (the markup, not the window).
A demo
UPDATE
For binding an event on a dynamic element (in your case the button) you could do the following
content: 'your pos' + pos + '<button id="myButton"></button>'

And in your js script do the following
$("body").on("click", "#myButton", function(e) {
    // ...
});  

Mind the fact that the above is a method of the jQuery object so be sure to include the jquery library.
A new demo press the button and see the alert that is being called in the binding

