将 xml 属性转换为数组
在以下 XML 中:
<myxml>
<photos>
<photo url="1.jpg"/>
<photo url="2.jpg"/>
<photo url="3.jpg"/>
<photo url="4.jpg"/>
</photos>
</myxml>
如何使用 e4x 提取 url 并使用最少的代码将它们推送到数组中?
In the following XML:
<myxml>
<photos>
<photo url="1.jpg"/>
<photo url="2.jpg"/>
<photo url="3.jpg"/>
<photo url="4.jpg"/>
</photos>
</myxml>
How do I use e4x to extract the urls and push them in an array with the least possible code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试一下:
try that:
这是一行代码:
编辑:实际上上面的行生成一个数组,其中包含所有 url 的一长串。为了生成一个有用的数组,您需要这样做:
It's one line of code:
Edit: Actually the above line produces an array with one long string of all the urls. in order to produce a useful array you would want to do this: