您的位置:首页 > Web前端

Difference of Getting DOM ElementsM Between IE6 & FF2

2008-07-04 21:27 375 查看
Considering the following piece of XSLT
<xsl:template match="/uo_content/attractions/ride"> ...</xsl:template>
How about if we want to get the "template" element from this document?
var template = doc.getElementByTagName("xsl:template")[0] // <--It does work, but only for IE
var template = doc.getElementByTagName("template")[0] // <-- Firefox only
var template = doc.getElementByTagName("xsl:template")[0] || doc.getElementByTagName("template")[0] //<-- Both
Consider that "xsl" is a namespace but not a part of the tag name, I think Firefox way is better.(Tested in IE6 and FF2)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: