ファイルtest.txt内にxml形式でデータを保存しています。
<element-list>
<element>
<name>sam</name>
<title>header</title>
</element>
<element>
<id>3732</id>
<name>mad</name>
<title>header</title>
</element>
</element-list>
コードを使用してajaxリクエストを使用してそのファイルにアクセスしようとしていますが、
$.ajax({
type : 'GET',
//url : "http://localhost:8080/cleo-primer/rest/elements/search?uid=1&query="+$("#srchBox").val() ,
url: 'json/test.txt',
dataType: 'xml',
success : function result(s){
console.log(s.element[k].term[j] + " / " + s.element[k].title) ;
},
error: function(xhr, textStatus, error) {
console.log('status: ' + textStatus);
console.log(xhr.responseText + " / " + xhr.status);
//showError('an unknown error occurred while trying to fetch the feed: ' + xhr.status);
}
});
エラー以外の応答がありませんか?? 何が間違っているのでしょうか??