I was using the technique described here http://stackoverflow.com/questions/2217267/click-event-in-google-map-infowindow-not-caught to dynamically add click event handlers to some of the content added to the Google Map InfoWindow. Works great except in IE.
I have content with normal anchor tags and those links work just fine.
I have an anchor tag with a jQuery (live) click handler read the id to trigger some other action and it does nothing in IE. Chrome/FF etc work just fine. I've tried using a div and span with no change to the behavior.
Any ideas?
Edit: This is with Google Maps v2 (I do know it is deprecated) and doesn't work in IE 7 or 8. Haven't bothered with IE6 on this project.
Edit: Here is a some sample code that repos the behavior.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
#gmap{ height:450px;width:350px; }
</style>
<script type="text/javascript">
var gmap;
var sampleLatLon = new GLatLng(37.4419, -122.1419);
var sampleIcon = new GIcon(G_DEFAULT_ICON);
$(document).ready(function () {
// Google maps setup
$(window).unload(function () { GUnload(); });
var gmap = new GMap2(document.getElementById("gmap"));
gmap.setCenter(sampleLatLon, 13);
gmap.setUIToDefault();
// Marker and InfoWindow setup
var marker = new GMarker(sampleLatLon, { icon: sampleIcon });
var infoWindowMarkup = '<a id="infowindow-1" class="clickeventvialive">click me</a>';
marker.bindInfoWindowHtml(infoWindowMarkup);
gmap.addOverlay(marker);
$('.clickeventvialive').live('click', function () {
alert('Are you Internet Exploder??');
});
});
</script>
</head>
<body>
<div id="gmap"></div>
</body>
</html>