将解析后的 XML 放入 JavaScript 数组中?
我的挑战是获取 XML 提要,解析它,然后将解析后的数据放入 JavaScript 数组中,然后由 jquery 读取该数组并输出到页面上。 jquery 端已编写并使用静态数组。我还可以解析 XML。但是解析后的 XML 提要可以填充数组吗:
var text = new Array();
text [1] = "first item parsed"
text [2] = "second item parsed"
etc.
My challenge is to take an XML feed, parse it, then put parsed data into a javascript array which is then read by jquery to output on a page. The jquery side is written and works with a static array. I also can parse the XML. But can a parsed XML feed populate an array such that:
var text = new Array();
text [1] = "first item parsed"
text [2] = "second item parsed"
etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以简单地循环“items”,
请使用它按顺序将“items”添加到空白数组
If you can simply loop through the "items"
use this to sequentially add "items" to a blank array