我想在运行时在 javascript 中添加一些代码,这些代码取决于动态写入某些数据的文件。我希望将这些数据写入我的 javascript 代码中。任何帮助将不胜感激谢谢:)
  function initialize() {
                  var myLatLng = new google.maps.LatLng(0, -180);
                  var map = new google.maps.Map(document.getElementById("map_canvas"),
  myOptions);
                  var flightPlanCoordinates = [
                                        new google.maps.LatLng(37.772323, -122.214897),
                                        new google.maps.LatLng(21.291982, -157.821856),
                                        new google.maps.LatLng(-18.142599, 178.431)
                                               ];
                  flightPath.setMap(map);
            } 
我想使用循环动态设置 flightPathCoordinates ....