This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: : Problems with Javascript block / Netscape
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] : Problems with Javascript block / Netscape
- From: "Uronis, Jeremy" <Jeremy dot Uronis at usa dot xerox dot com>
- Date: Fri, 17 Aug 2001 09:45:33 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
>Michael wrote:
>And there are two further points in favour of this approach.
>1) Since an XML editor and and XSLT processor will let you accidentally
>damage the innards of a <script> element while editing the XSLT code,
>it's much better to keep the static parts out of harm's way in their own
>js libraries
>2) You can invoke such libraries from multiple html pages. That way,
>they can stay cached after the first invocation and don't get sent
>again, even if the main page is refreshed.
you have good points. ill move the code out when i get a chance.
i did work the problem out though. i was wrong in my initial post.
ns can handle code such as < in javascript.
when reading msdn it said to write your javascript block like so:
<SCRIPT LANGUAGE="javascript" DEFER="true">
<xsl:comment>
<![CDATA[
if(document.forms[0].lstSelectedCats &&
document.forms[0].lstSelectedCats.length==0){
document.forms[0].lstSelectedCats.length = 1;
<snip>
]]>
</xsl:comment>
</SCRIPT>
the closing xsl:comment is what was causing the problem with netscape. in
order for this code to
work in both ie and ns you need to close your xsl:comment with two forward
slashes first like so:
//</xsl:comment>
thanks -
jeremy
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list