1

这是我的代码。 JS小提琴

我通过xml从mysql获取数据。它工作正常。但是 iu 必须像这样通过 xml 从 mysql 获取第二个查询。但它不起作用。脚本停止工作。我怎样才能对 JS 文件进行 2 个或多个 ajax 查询?..

这部分是我手动写的。它必须由脚本生成..但是当我通过 xml(通过 ajax)执行此操作时,脚本将无法工作:(

对不起我的英语不好。

       flightPlanCoordinates = [
                 new google.maps.LatLng(40.9921196514,47.8604733650 ),
                 new google.maps.LatLng(40.9922511293,47.8606186245 ),
                 new google.maps.LatLng(40.9926358563,47.8611079146 ),
                 new google.maps.LatLng(40.9929381070,47.8615028229 ),
                 new google.maps.LatLng( 40.9931715315,47.8620863814 ),
                 new google.maps.LatLng( 40.9933869955,47.8623375976 ),
                 new google.maps.LatLng(40.9936024589,47.8625888155 ),
                 new google.maps.LatLng(40.9942600516, 47.8634730879 ),
                 new google.maps.LatLng(40.9946698905, 47.8639284456),
                 new google.maps.LatLng(40.9951427577,47.8643998201 ),
                 new google.maps.LatLng(40.9956477404 ,47.8648835770),
                 new google.maps.LatLng(40.9959645185, 47.8651699964),
                 new google.maps.LatLng( 40.9962812958, 47.8654564186 ),
                 new google.maps.LatLng( 40.9965401588,47.8657069220 ),
                 new google.maps.LatLng( 40.9970324883 ,47.8661781983),
                 new google.maps.LatLng(40.9972659548, 47.8663989707 ),
                 new google.maps.LatLng(40.9975468767, 47.8664409273),
                 new google.maps.LatLng( 40.9978740427,47.8662277913 ),
                new google.maps.LatLng( 40.9982012084,47.8660150777 ),
                    new google.maps.LatLng( 40.9985497469,47.8658461824),
 new google.maps.LatLng(40.9988327045,47.8660951747),
  new google.maps.LatLng(40.9991045183,47.8664072712),                
   new google.maps.LatLng(40.9992585926,47.8665868156),                    





        ];
        var flightPath = new google.maps.Polyline({
          path: flightPlanCoordinates,
          strokeColor: '#FF0040',
          strokeOpacity: 1.0,
          strokeWeight: 2
        });

        flightPath.setMap(map);



  google.maps.event.addListener(flightPath,'mouseover', function() {


        this.setOptions({strokeColor: '#3ADF00' });
           this.setOptions({strokeOpacity: 1.0 });
           this.setOptions({strokeWeight: 4 });
  });

     google.maps.event.addListener(flightPath,'mouseout', function() {


        this.setOptions({strokeColor: '#FF0040' });
           this.setOptions({strokeOpacity: 1.0 });
           this.setOptions({strokeWeight: 2 });
  });




       var mpenc = new google.maps.InfoWindow();
  var contentString ="informasiya burada olacaq ";
  google.maps.event.addListener(flightPath,'click', function(event) {
    mpenc.setContent(contentString);
    mpenc.setPosition(event.latLng);
    mpenc.open(map);
  });

当我添加第二个 ajax 查询脚本时停止。为什么 ?我不能同时使用 2 个或更多 ajax 查询??请帮忙..

 // Change this depending on the name of your PHP file
      downloadUrl("gxml.php", function(data) {
        var xml = data.responseXML;
        var markers = xml.documentElement.getElementsByTagName("marker");

} 
4

0 回答 0