On 28/12/06, Vincent Majer <[EMAIL PROTECTED]> wrote: > Hi, > > I'm working on the plugin for jquery : > http://olbertz.de/jquery/googlemap.html > > it's really great with firefox.. but it doesn't work in IE... > > I've made some tests and it seems that the problem comes from this > foreach : > > locations.forEach(function(element, index, array) { > var marker = new GMarker(new GLatLng(element.latitude, > element.longitude), {title: element.name}); > map.addOverlay(marker); > GEvent.addListener(marker, 'click', function() { > marker.openInfoWindowHtml('Name: <b>'+element.name+'</b><br > />Latitude: <b>'+element.latitude+'</b><br />Longitude: > <b>'+element.longitude+'</b>'); > }); > link = '<a href="#" > onclick="moveMapTo('+index+')">'+element.name+'</a><br />'; > $('p#location_list').append(link); > }); > > > locations.forEach seems to cause problems with IE... > Is there a workaround ? > > thanks in advance
Looping through an array with Array.forEach only works in Firefox 1.5+ (not sure about Opera or other non-Windows browsers). However, there is an implementation by Dean Edwards that adds it to browsers that don't support it: http://dean.edwards.name/weblog/2006/07/enum/ _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
