ええと、私はAjax PostリクエストにJQueryを使用していて、データを取り戻していました。
Ajaxは正常に動作していますが、次のようになります。
coordinates = [];
$.post("ajax_markers.php",{time:time},function(result) { coordinates=result.split(','); alert(coordinates); }); // Alerts the Coordinates as Expected :)
だが..
$.post("ajax_markers.php",{time:time},function(result) { coordinates=result.split(','); });
alert(coordinates); // Alerts with a Blank Box :(
なぜこうなった ?
座標は両方に対してグローバルであるため、両方が同じデータでアラートを出す必要があります。