如果我从下拉菜单中选择任何内容,则不会调用 javascript 函数 showLeague 并引发错误:Uncaught ReferenceError: showLeague is not defined
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="html"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
indent="yes"></xsl:output>
<xsl:param name="tsid" />
<xsl:template match="spocosy">
<form>
Select a League:
<select>
<xsl:attribute name="name">
<xsl:value-of select="cds"/>
</xsl:attribute>
<xsl:attribute name="onchange">
showLeague(this.value)
</xsl:attribute>
<option value="">Leagues:</option>
<xsl:for-each select="standing">
<option>
<xsl:attribute name="value">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:value-of select="@league"/>
</option>
</xsl:for-each>
</select>
</form>
<div id="txtHint"><b>League info will be listed here...</b></div>
</xsl:template>
showLeague 函数在 head 标签中定义,没有 xsl 它可以正常工作。任何帮助,将不胜感激。如果你想观察 html 输出,这里是 url:http ://tipslator.com/Table/deneme/