0
我已經嘗試了許多方法來訪問XSL變量的JavaScript這裏是我的代碼,請幫我找到解決辦法如何訪問在JavaScript
<xsl:variable name="VariableName">
<xsl:for-each select="ROW/COL/LIST-BOX/DATA">
<xsl:choose>
<xsl:when test="position() =1">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
|<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<body>
<xsl:attribute name='onLoad'>javaScript:userDetails()</xsl:attribute>
<script type="text/javascript" language="javascript">
function userDetails()
{
var title = <xsl:value-of select="$VariableName"/>;
alert(title);
}
</script>
</body>
.... – user3315903