I'm trying to loop through a php array in javascript to run them into a function but the $counter variable does not want to get incremented no matter what I do.
Code:
**inside of javascript
var jsize = <? echo $size; ?>;
for(var i = 0; i < jsize; i++)
{
var y = <? echo $la[$counter]; ?>;
var x = <? echo $lo[$counter]; ?>;
var latlng = new GLatLng(y, x);
<? $counter = $counter + 1; ?>
map.addOverlay(createMarker(latlng, i));
}
**/end of javascript