I have created a template in ItemStyle.xsl for CQWP.
I want to store the xsl variable value that is returned from javascript:
My template is:
<xsl:template name="DepartmentsTemplate" match="Row[@Style='DepartmentsTemplate']" mode="itemstyle">
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="CurrSite"/> // I want this variable value to be assigned from javascript function return value.
<a> <xsl:value-of select="substring-before(@Department,'|')" disable-output-escaping="yes"></xsl:value-of></a>
</xsl:template>
Javascript function is:
function getValue()
{
var url = location.protocol + "//" + location.host + L_Menu_BaseUrl;
var n= url.lastIndexOf("/");
var currSite = url.substring(n+1,url.length);
return currSite;
}
How do I accomplish this?
Javascript function is defined in another js file that is, it is not written in the ItemStyle.xsl