106
rated 0 times
[
113]
[
7]
/ answers: 1 / hits: 34010
/ 13 Years ago, sun, may 29, 2011, 12:00:00
i am trying to pass an xsl variable value to a javascript function.
My xsl variable
<xsl:variable name=title select=TITLE />
i'm passing the value like this
<input type=button value=view onclick=javascript:openPage('review.html?review=$title') />
i have tried the above code in different possible ways but i gets errors.
<script type=text/javascript>
function jsV() {
var jsVar = '<xsl:value-of select=TITLE/>';
return jsVar;
}
</script>
<input type=button value=view onclick=javascript:openPage('javascript:jsV()') />
I also tried
<input type=button value=view onclick=javascript:openPage('review.html?review='''
+$title+'') />
Is there alternative way or am i not doing it right?
More From » xslt