
定义和用法
baseURI 属性返回 xml 文档的位置(URI)。
语法
elementNode.baseURI
实例
下面的代码片段使用 loadXMLDoc() 把 "books.xml" 载入 xmlDoc 中,并显示 XML 文档的位置:
实例
xmlDoc=loadXMLDoc("books.xml"); x=xmlDoc.getElementsByTagName("book")[0]; document.write("Document location: " + x.baseURI);
输出:
Document location: https://www.voidme.com/try/demo_source/books.xml
