我为此函数调用模板显示了一些细节。 它在IE9中工作,但在IE11中不工作。如何使它与IE11兼容? 事件没有被调用。
<xsl:template name="DrillLink">
<xsl:param name="ObjectName" select="''"/>
<xsl:param name="ObjectID" select="''"/>
<xsl:choose>
<xsl:when test="(@ObjectType = 'BO' or @ObjectType = 'SO') and @DetailEnabled = '1' and @HideDetail = '0' ">
<span href="javascript:;" onMouseOver="window.status='Drill down {@ObjectName}'; return true;" value ="'0'" onMouseOut="window.status=''; return true;"
onClick="showDetail(this); return false;" box_name="expand" id="ShowDetail" style="margin-right:5;" detailIndent="1"
title="{@ObjectDetailText}"
OrderKey="{@OrderKey}"
StartDate="{@Date}" EndDate="{@Date}"
ObjectID = "{@ChildObjList}"
Duration = "{@Date}"
TimeZoneID = "{@TimeZoneID}"
TransformUpID = "{@TransformUp}"
TransformDownID = "{@TransformDown}"
RoundTypeID = "{@RoundType}"
PrecisionID = "{@Precision}"
CarryForwardPrecisionID = "{@CarryForwardPrecision}"
UserID = "{@UserID}"
EnableObjectType = "{@ObjectType}"
DisplayBuilderID = "{@DisplayBuilderID}"
RealTimeView = "{@RealTimeView}"
ForwardHour = "{@ForwardHour}"
BackwardHour = "{@BackwardHour}"
class = "dmActionBtn"
>+</span>
<xsl:text>&#160;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="normalize-space(@ObjectID) = 0 ">
<xsl:text>&#160;</xsl:text>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
答案 0 :(得分:0)
有一些问题:
onClick
应为小写, onclick
onMouseOver
应为小写, onmoueover
onMouseOut
应为小写, onmouseout
有些浏览器容忍(不正确)大写,有些浏览器不容忍(这可以解释它们之间的不一致)。
此外,请注意,您应该不使用内联事件处理程序,而应该使用 addEventListener
来附加相应的事件元素:
document.getElementById("button").addEventListener("click", function() {
console.log('Clicked');
});
<button id="button">Click</button>
希望这有帮助! :)