Adding an onclick event to google.map marker
Make sure the marker is defined outside of initialize(). Otherwise, it will be undefined if you attempt to assign the click listener outside of initialize(). Also, you may have SAME-ORIGIN issues if you attempt to load url www.google.com, but it should work fine with a local url. Updated code var myCenter=new google.maps.LatLng(53, -1.33); var marker=new … Read more