Basically, I’m looking to get ‘URLValue’ if the particular <a> is clicked and pass it on to another method. There are several other <a> elements with class=”LinkClass” and I have written a JQuery to get only the clicked element value.
Below is a working JQuery to do just this, it references the XSL.
$("a.LinkClass").live("click", function() {
var URL = $(this).attr("href");
//Now call another method passing this value
});
However, can I use the value directly through XSL, triggering a function call on event click for the link?
XSL below:
<a class="LinkClass">
<xsl:attribute name="href">
<xsl:value-of select="URLValue"/>
</xsl:attribute>
</a>
When this XML document is open on browser:
And this stylesheet as “test.xsl”:
Output:
And alerts works on click.