velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@alaska.net>
Subject Re: Can we access velocity contexts from inside javascript
Date Wed, 13 Oct 2004 19:08:41 GMT
Barbara Baughman <baughman@utdallas.edu> wrote:
> Velocity is rendered on the server side, replacing Velocity code with
> strings, not any Java or Javascript object.  The rendered template is
> sent to the browser client.  When javascript attempts to work on the
> client side there is no VelocityContext to work with any more.  So be
> sure your rendered code already has the information javascript needs
> from the Velocity context before sending it to the client.

And if you need velocity context data made available to your javascript, 
then, in your velocity template, you need to generate the javascript code to 
create that data so the data is available once the web browser receives and 
interprets the javascript.

-Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message