XML:如何將兩個函數放在一個onclick屬性中? XSLT
<CONTROLS>
<BUTTON>
<input name="myButton" onclick="existingFunction();"/>
</BUTTON>
<LABEL>
Text ME
</LABEL>
</CONTROLS>
XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="input">
<input onclick="{@onclick}newFunction();">
<xsl:copy-of select="@*[not(name()='onclick')]"/>
</input>
</xsl:template>
</xsl:stylesheet>
我怎樣才能把兩種功能於一體onclick屬性?
結果:
<input onclick="existingFunction();newFunction();" name="myButton"/>
它不工作。有沒有其他的方式來合併這兩個功能?
我不想把函數2函數內部1. :)
是什麼'它不是working'究竟意味着什麼呢?你的意思是'onclick'的實際功能嗎? –