cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhavya Sharma" <bhavyasha...@gmail.com>
Subject Re: Using xsl variables in javascript
Date Thu, 14 Feb 2008 07:00:33 GMT
As i think first you need to take the value of xsl variable into a
javascript variable , that you can do like this
<script language="javascript">
var mparam="<xsl:value-of select='$myparam'/>";
if(mparam=='x')
{
// your statement
}

</script>

On Feb 14, 2008 2:50 AM, Lincoln Mitchell <
lincoln@interfaces-n-creatives.com> wrote:

>  Hi all,
>
> I am trying to use an xsl parameter in an external javascript file.
>
> Do I have to use Control Flow / Flowscript to achieve this?
>
> The docs say Control Flow is about "…the ability to describe the order of
> Web pages…" and in my case I don't need to do this.
>
> I simple need to convert this inline javascript:
>
> <script type="text/javascript">
>
>   function myFunction(){
>
>   <xsl:choose>
>
>     <xsl:when test=" $myParam='x'">
>
>       alert('x')
>
>     </xsl:when>
>
>   </xsl:choose>
>
>   }
>
> </script>
>
>
>
> …to an external javascript file like:
>
> function myFunction(){
>
>     if ($myParam='x'){
>
>       alert('x')
>
>     }
> }
>
>
>
> Thanks for any help on the issue.
>
>
>
> Linc
>



-- 
Thanks

Bhavya Sharma

Mime
View raw message