cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gou...@osmosis.gr
Subject RE: Does anyone have javascript working in an xsp page?
Date Thu, 25 Sep 2003 09:00:24 GMT
create your .js file
myscript.js for example

and load this file in your xslt

xslt ----
	<xsl:template match="???">
		.....
		.....
		<script src="myscript.js"></script>
		.....
		.....
	</xsl:template>

or something more flexible:
create your <script> element in your .xml and add a xsl template like 

	<xsl:template match="script">
		<script>
			<xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
		</script>	
	</xsl:template>

be sure that you have a map:pattern in your sitemap that allow you to read 
.js files 

try to ask your .js from cocoon

http://foo.org/cocoon/your/path/myscript.js to check if cocoon serve your 
script files 


Be carefull
if your client is IE you have to avoid to generate the html (xhtml) script 
tag as [<script scr="myscript"/>]. you will get blank page 

use  [<script .... ></script>] 



--stavros

On Thu, 25 Sep 2003, Darach Cawley wrote:

> Hi again,
> Thanks for your help guys but I've another question!  How can you add
> javascript code into an xslt?
> Are there tags like CDATA that you use?
> 
> Darach.
> 
> -----Original Message-----
> From: Geoff Howard [mailto:cocoon@leverageweb.com]
> Sent: 24 September 2003 22:24
> To: users@cocoon.apache.org
> Subject: Re: Does anyone have javascript working in an xsp page?
> 
> 
> Darach Cawley wrote:
> 
> > Does anyone have javascript working in an xsp page?
> > I'd like to have a javascript calendar in my xsp page.
> > I'm hoping someone has tried it before, cause it doesn't work for me and
> I'm
> > stuck!
> 
> Yes, of course, but your question shows you may be a litte confused.
> Are you trying to run a browser based javascript calendar tool in an xsp
> page using javascript as the serverside programming language?  XSP can
> use javascript for serverside processing, and can return javascript
> (although it has no business being in the xsp - it should be introduced
> later via xslt probably) to the browser for use there, but they are
> different environments and shouldn't be confused.
> 
> HTH,
> Geoff
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.515 / Virus Database: 313 - Release Date: 01/09/2003
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.515 / Virus Database: 313 - Release Date: 01/09/2003
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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


Mime
View raw message