Re: [xsl] How to create client side function in HTML with XSL

Subject: Re: [xsl] How to create client side function in HTML with XSL
From: Rick Taylor <taylor@xxxxxxxx>
Date: Thu, 10 Apr 2003 10:57:01 -0600
Ilse,

Simply add the onClick attribute and specify the function:

<a href="#" id="{ID}" onClick="myFunction();"><xsl:value-of select="ID"/></a>

you can provide the function by including a js file or putting the code in a script element:

<script type="text/javascript" language="javascript" src="myscript.js">

<script type="text/javascript">

<![CDATA[

   function myFunction()
     {
      alert('this is my function');
     }

   ]]>
  </script>

You might want set href="javascript:void(0)" instead of href="#"

-rick


At 11:25 AM 4/10/03 +0200, you wrote:
I'm new on XSL...

In my XSL file I create a weblink with following code:

<a href="#" id="{ID}"><xsl:value-of select="ID"/></a>

This weblink must have client side code on the "OnClick"-event.
How can I create a client side function for this weblink in XSL?

Thanks.
Ilse






_________________________________________________________________
Ontvang je Hotmail & Messenger berichten op je mobiele telefoon met Hotmail SMS http://www.msn.be/gsm/smsservices



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Rick Taylor XML Developer PPDM Association


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread