菜鸟问javascript基础问题
for(var len=0;len<200;len++){google.maps.event.addListener(markerList[len].marker, 'click', function(){ markerList[len].infoWindow.open(map,this); });}function createpack(len){return function(){ markerList[len].infoWindow.open(map,this);}}//做闭包for(var len=0;len<200;len++){google.maps.event.addListener(markerList[len].marker, 'click',createpack(len) );}