0
我試圖把我的XML標記結果,並將其加載到地圖,但後結果我在我的變量是說我警惕的是:不能得到所有崗位上取得成功的XML數據
數據加載:對象的XMLDocument]
這是我的代碼是什麼樣子:
function SendData() {
//get data from inputs
$.ajax({
type: "POST",
url: "MapSearchxml.php",
data: {
dataFromDate: FromDate,
//some more data
dataHasPatio: HasPatio
},
beforeSend: function (html) { // this happens before actual call
},
success: function (html) { // this happens after we get results
alert("Data Loaded: " + html);
}
});
}
在Firebug中,後的反應是這樣的:
<markers><marker id="1" lat="48.153938" lng="17.108459" /></markers>
我嘗試設置數據類型,以這樣的XML:
success: function (html) { // this happens after we get results
alert("Data Loaded: " + html);
},
dataType: 'xml'
});
}
然而沒有變化發生。
這裏是我的XML的PHP代碼:
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
header("Content-type: text/xml");
echo '<markers>';
while ($row = @mysql_fetch_assoc($result)){
echo '<marker ';
echo 'id="' . parseToXML($row['ID']) . '" ';
echo 'lat="' . parseToXML($row['LAT']) . '" ';
echo 'lng="' . parseToXML($row['LNG']) . '" ';
echo '/>';
}
echo '</markers>';
你期望得到什麼回報?你能否也顯示你的PHP代碼? – mccannf
嘿mccannf,我期待這件事返回' '。我將用php代碼編輯我的帖子。 –
pufAmuf