cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@ciber.com>
Subject RE: how-to reference external js from cocoon 2.2 block
Date Thu, 04 Jun 2009 08:57:12 GMT
Thx a lot Joachim,

You saved me a lot of headache ;-)

I knew it was somehow related to cocoon because if I would copy-paste the generated code in
a plain .html file it would render without any problems.  I just didn't know the exact cause.

Cheers mate !!

Robby

-----Original Message-----
From: Jasha Joachimsthal [mailto:j.joachimsthal@onehippo.com] 
Sent: Thursday, June 04, 2009 10:40 AM
To: users@cocoon.apache.org
Subject: Re: how-to reference external js from cocoon 2.2 block

2009/6/4 Robby Pelssers <robby.pelssers@ciber.com>:
> Hi all,
>
>
>
> I'm a bit puzzled about how to reference an external javascript file.
>
>
>
> Let's say I've put it in
>
>
>
> src/main/resources/external/js/test.js
>
>
>
> I thought about referencing it the same way as my css file but somehow this
> does not work.  Can someone explain how I can accomplish this?  Now adding
> the <script> line in my xslt gives me an empty html page.
>
>
>
> Thx in advance,
>
> Robby
>
>
>
>   <xsl:template match="/">
>
>       <html>
>
>         <head>
>
>           <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"
> />
>
>           <title>My Cocoon block</title>
>
>           <link type="text/css" rel="stylesheet"
> href="resource/external/css/styles.css"></link>
>
>           <script type="text/javascript"
> src="resource/external/js/test.js"></script>
>
>         ...
>
>  </xsl:template>
>

You're probably using some variant of the XMLSerializer which "closes"
the script HTML tag. Browsers don't get that and render empty pages
although the view source does display all HTML. Add a &#160; in the
script tag.


Jasha Joachimsthal

j.joachimsthal@onehippo.com - jasha@apache.org

www.onehippo.com
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-5100 +1 (707) 773-4646

---------------------------------------------------------------------
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