![](/img/trans.png)
[英]Way to create a xsl variable using javascript variable from another file?
[英]How to create href in xsl using javascript variable
我正在使用下面的代碼來創建 href
<xsl:template name="pageHeader">
<h1><xsl:value-of select="$TITLE"/></h1>
<table width="100%">
<tr>
<tr>
<td align="right">Designed for use with <a <xsl:attribute name="href">javascript:returnHyperlink();</xsl:attribute> >JUnit</a> </td>
</tr>
</table>
<hr size="1"/>
</xsl:template>
</script>
<script type="text/javascript" language="JavaScript"><![CDATA[
function returnHyperlink ()
{
var scrt_var =cur['env.PBCS_VERSION'];
return scrt_var;
}
]]>
</script>
有人請糾正我代碼中的錯誤
您的 XSL 代碼甚至格式不正確。
使用此代碼創建屬性:
<a><xsl:attribute name="href">javascript:returnHyperlink();</xsl:attribute>JUnit</a>
或喜歡:
<a href="javascript:returnHyperlink();">JUnit</a>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.