[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] javascript


Subject: Re: [xsl] javascript
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 13 Mar 2002 15:12:24 +0000

Hi Stevenson,

> In xsl, how can I insert a JavaScript? I have tried:
>
> <Script language="JavaScript" src="functions.js"></script>
>
> But it didn't work. Can someone help?

I've found that Internet Explorer doesn't like script elements that
don't have any content (perhaps because with the XML output method
they don't have a close tag). You can get around the problem by
inserting a comment within the script element:

  <script type="text/javascript" src="functions.js">
    <!-- comment inserted for Internet Explorer -->
  </script>

You can generate this script element from XSLT with:

  <script type="text/javascript" src="functions.js">
    <xsl:comment> comment inserted for Internet Explorer </xsl:comment>
  </script>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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



Current Thread
Keywords