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)
<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)
相关文章推荐
- Difference of Getting DOM ElementsM Between IE6 & FF2
- The differences of Circuit Maintenance Messages between BICC &amp; ISUP
- reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier cellIdentifie
- The contenTht of element type "package" must match "(result-types?,interceptors?,default-intercept .
- The difference between Union & Union All in SQL Server/pOSTGRESQL
- Multiple annotations found at this line: - cvc-elt.1: Cannot find the declaration of element 'ehcac
- Getting the ID of the element that fired an event using jQuery
- The content of element type "package" must match...
- The content of element type "web-app" must match……问题之解决办法
- cvc-elt.1: Cannot find the declaration of element 'taglib'的解决方法
- 高手提领 之 Douglas Crockford: "Theory of the DOM"
- Difference between "/0" and '/0' and '0' and 0
- pesudo-class of <a> element
- Selenium - Difference Between Implicit, Explicit & Fluent Wait
- web.xml中提示错误The content of element type "web-app" must match
- Calculate difference between two dates (number of days) in C#?
- What are the differences between shell , console & terminal?
- what is difference between equals() and contentEquals() of String class?
- Q & A: The difference between hard and soft links
- What's the difference between a URI and a URL?