我正在尝试将xml文件的url加载到我的页面中,然后使用jQuery或ajax将xml中的“text”加载到字符串中。我不知道属性。到目前为止,我一直在尝试这个问题,而且还没有解决这个问题:
$(document).read(function){
$.get(infile, function(xml){
string = $(xml).text());
}
});
document.getElementById("input").innerHTML = string;
有什么想法吗?
答案 0 :(得分:0)
您的脚本有很多错误。试试这个:
$(document).ready(function(){
$.get(infile, function(xml){
$("#input").text(xml);
});
});