2009/6/4 Robby Pelssers <[email protected]>: > 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   in the script tag. Jasha Joachimsthal [email protected] - [email protected] 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: [email protected] For additional commands, e-mail: [email protected]
