Javascript 如何将两个函数放在一个onclick属性中?XSLT
XML:Javascript 如何将两个函数放在一个onclick属性中?XSLT,javascript,Javascript,XML: 发短信给我 XSLT: 如何将两个函数放在一个onclick属性中 结果: <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 oncl
发短信给我
XSLT:
如何将两个函数放在一个onclick属性中
结果:
<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>
它不起作用。有没有其他方法可以合并这两个函数
我不想将函数2放入函数1中。:) 您喜欢这项工作吗
<input onclick="existingFunction();newFunction();" name="myButton"/>
你喜欢这个工作吗
<input onclick="existingFunction();newFunction();" name="myButton"/>
备选答案:
对onClick事件调用function3()。。看起来像
onclick="function baz(){foo(); bar();} baz();"
// or
onclick="(foo(); bar(); baz(); derp(); ... )()";
备选答案:
对onClick事件调用function3()。。看起来像
onclick="function baz(){foo(); bar();} baz();"
// or
onclick="(foo(); bar(); baz(); derp(); ... )()";
它不工作的确切含义是什么?您是指onclick
的实际功能吗?不工作的确切含义是什么?您的意思是点击按钮的实际功能吗?@Daniel是的,当按钮按下时,这两个功能不起作用clicked@Daniel是,单击按钮时,这两个功能不执行