[英]Get all nodes of an XML file without knowing the tag names
我正在嘗試將xml文件的url加載到頁面中,然后使用jQuery或ajax將xml中的“文本”加載到字符串中。 我不知道屬性。 到目前為止,我一直在嘗試此方法,但尚未解決:
$(document).read(function){
$.get(infile, function(xml){
string = $(xml).text());
}
});
document.getElementById("input").innerHTML = string;
有任何想法嗎?
您的腳本有很多錯誤。 嘗試這個:
$(document).ready(function(){
$.get(infile, function(xml){
$("#input").text(xml);
});
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.