复制代码$.ajax({
type: "GET",
url: "books.xml",
dataType: "xml",
success: function(xml) {
var xmlDoc = $.parseXML(xml),
$xml = $(xmlDoc),
books = [];
$xml.find("book").each(function() {
var book = {
name: $(this).find("name").text(),
author: $(this).find("author").text(),
price: $(this).find("price").text()
};
books.push(book);
});
console.log(books);
}
});
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
上面是“如何将XML解析后的对象保存到JavaScript中”的全面内容,想了解更多关于 js 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_4198.html
workflows工作流
一张由表情符号组成的照片ComfyUI工作流
一只巨大的极其精细的鞋子ComfyUI工作流
晚上樱花狐狸ComfyUI工作流
一只蚂蚁在花丛中找食物ComfyUI工作流
一只猫捧着一条鱼ComfyUI工作流
蝴蝶兰comfyui工作流
一个迷人而丰满的女巫和一只黑猫骑着飞天扫帚
一只被水晶包围的小动物ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!