If the javascript will change often then it's probably best to include it 
directly into the <head> of the page, otherwise it's just another HTTP request 
that probably won't be cachable.  So to put something in the <head>, you can 
try a StringHeaderContributor or implement IHeaderContributor.

If you really want to use a file, I guess you could probably use 
JavaScriptResourceReference.  The Resource itself would be WebResource or one 
of its subclasses and would return a StringResourceStream that wraps your 
generated JS.  This is just a guess though since I haven't actually tried it.

Craig

-----Original Message-----
From: Steven Haines [mailto:[email protected]]
Sent: Tuesday, April 06, 2010 9:32 AM
To: Wicket User List
Subject: Build custom JavaScript

For my application I need to dynamically generate JavaScript, which can either 
be in its own file or even added to my HTML document. I'll handle the 
generation of the JavaScript, but does anyone have any good strategies for 
injecting it into a web page or even generating a JavaScript file with Wicket?

Thanks
Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to