データが javascript/jquery フロント エンドにプッシュされる WCF プロジェクトがありますが、データを使用して各フィールドを Google マップに挿入しようとしているという問題があります。C# のリストのレコードは 1 つしかないのに、アラート ボックスでデータを表示しようとすると、そのレコードが複数回表示されます。私は何を間違っていますか?以下の私のコードを見つけてください:
function onSuccess(result) {
var DArray = new Array();
var data = result;
$.each(data, function (index, item) {
alert(DArray.push(result));
// alert(data.LocId);
//document.getElementById("locid").value = data.LocId;
//alert(data.Title);
//alert(data.Loc);
//alert(data.Lat);
//alert(data.Long);
// alert(data.length);
});
function onFail() {
document.getElementById("locid").value = "Error";
document.getElementById("title").value = "Error";
document.getElementById("loc").value = "Error";
document.getElementById("lat").value = "Error";
document.getElementById("long").value = "Error";
}
}