XSL:
<script type="text/javascript">
<xsl:value-of select="concat('replaceAll(',$idS,');')"/>
</script>
HTML:
<script type="text/javascript">replaceAll(ID0ED);</script>
Javascript:
$(function () {
var cityNameRye = $("#spnCityID0ED").text().split(";")[1];
if (cityNameRye.toLowerCase() == "rye") {
//do something
}
});
I get the following error in the console which causes an issue in the site:
Uncaught ReferenceError: replaceAll is not defined
Can I create a dummy function which clears out the error?
Put this function code somewhere when it could be loaded before those from XSL are executed:
And call it from XSL like: