Pass parameter to callback function

前端 未结 4 1886
有刺的猬
有刺的猬 2021-02-20 16:35

My code

// do ajax request and get JSON response

for (var i = 0; i < data.results.length; i++) {  
    result = data.results[i];
    // do stuff and c         


        
4条回答
  •  别跟我提以往
    2021-02-20 16:48

    Looks like you've got a closure problem. See these questions:

    • google maps api all markers opening the same infowindow
    • google maps trouble closures passing by reference
    • dynamically adding listeners to google maps markers

提交回复
热议问题