Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 XML 文件中有一个标签,看起来像这样:
<enclosure type="image/jpeg" length="99974" url="something" />
如何从此标签中获取图片的网址?
对于其他事情,我会这样做:
var Title = document.evaluate( '//item/title', dom, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
这是你要找的东西吗?:
var Title = document.evaluate('//enclosure/@url', dom, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );