cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey_M_Gross...@Countrywide.Com
Subject Re: kinda OT: problems generating javascript from xsl
Date Wed, 13 Sep 2000 00:17:47 GMT

One thing that we do is not to imbed the javascript in the page, but to
include the javascript file

In other words, our xsl looks like:

<SCRIPT LANGUAGE="JavaScript" SRC="script.js"/>

This way the client browser is able to cache the java script file, and you
never have to CDATA your java script!

Jeffery Grossman
Countrywide Home Loans
Jeffery_M_Grossman@countrywide.com



                                                                                         
                    
                                                                                         
                    
                                                                                         
                    




Hi everyone,

Maybe someone here can give this a shot.  I have some javascript I want to
run on the client side, so in my final xsl stylesheet I have something like
this:

<script Language="JavaScript">
                         //<xsl:comment><![CDATA[
                                   function
MoveItem(fromObj,toObj)
                                         {
                                              //
remove the primer option if it is still there.

                                              if
(toObj.options[0])

{

if (toObj.options[0].value=="primer") toObj.options[0] = null

}

//blah blah
                                         }

                    // ]]></xsl:comment>
     </script>

I get some wacky error about conditional commands not being set or
something

I noticed that when i do a "view source" in the browser, all my javascript
gets flattened into one line.  I would assume that the browser doesn't know
that that there are supposed to be seperate lines of code in there, and
maybe the browser's javascript interpreter is trying to parse html beyond
what's in the script tags because of that.  How can I get xsl to preserve
the carraige returns in my javascript?

Regards,
Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org





Mime
View raw message