title: how to pass a xsl variable value to a javascript function
body: <p>i am trying to pass an xsl variable value to a javascript function.</p>
  
  <p>My xsl variable</p>
  
  <pre><code>&lt;xsl:variable name="title" select="TITLE" /&gt;
  </code></pre>
  
  <p>i'm passing the value like this</p>
  
  <pre><code>&lt;input type="button" value="view" onclick="javascript:openPage('review.html?review=$title')" /&gt;
  </code></pre>
  
  <p>i have tried the above code in different possible ways but i gets errors. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
                      function jsV() {
                      var jsVar = '&lt;xsl:value-of select="TITLE"/&gt;';
                      return jsVar;
                      }
                  &lt;/script&gt;
  
                  &lt;input type="button" value="view" onclick="javascript:openPage('javascript:jsV()')" /&gt;
  
  I also tried 
  
  &lt;input type="button" value="view" onclick="javascript:openPage('review.html?review='\''
      +$title+'\')" /&gt;
  </code></pre>
  
  <p>Is there alternative way or am i not doing it right?</p>