0
我試圖用jQuery來解析XML,並且我遇到了問題。我使用了一個久經考驗的函數,並且它不斷跳過ajax部分。我不能爲我的生活找出爲什麼我無法運行這個。jquery ajax xml解析
$(function() {
$.ajax({
type: 'POST',
url: 'http://my.domain.tld/php/myapi.php', // the script to call to get data
data: "method=get_tbl_fields", // you can insert url argumnets here to pass to api.php, for example "id=5&parent=6"
dataType: 'xml', // data format
success: function(xml) { //on recieve of reply
alert('it worked');
}
});
});
如果你使用過它,你會在螢火蟲中發現任何錯誤 – Rafay
你會得到什麼錯誤?如果你在ajax請求之前放置了一個'console.log',它會被寫出來嗎? – Chris
「不斷跳過ajax部分」。你確定你的方法已被調用嗎? –