Jeffery Painter wrote:

My experience has been to move as much code as possible into .js files that do not require velocity processing as the .js files can be cached by the browser. However, by the nature of using velocity to generate javascript code, isn't it dynamic? I don't think there is an easy answer to your question.

Could you create a Javascript screen as we have seen others creating dynamic charts and linking to them in that manner, I would think maybe you can create a Javascript screen and have your code generated there as you call it from within the main .vm you are currently working on.

This still doesn't seem to have much benefit other than seperating the location of the code from the screen.

        Jeff Painter

On Fri, 28 May 2004, Bernardo Arlandis Ma�� wrote:



Hi. I've been using turbine for a while and i've been using velocity for generating html and javascript code inside .vm files, but now I'd like to take the javascript code out to its own .js file. That will make my pages smaller, but I can't use the velocity template engine inside .js files. Is there some way to not lose this functionality when working with external js files? How do you deal with this?

Thanks.




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





You've pointed something important, if the js code has to be regenerated there's no improvement other than having separate files. The js code should be static, but then I'd need to pass dinamically created collections of objects to the javascript functions to do their work. What I'd like to know is easy ways to do this or alternative ones with the same effect. For example, I need to pass a list of java objects generated by velocity to the javascript functions so that the js functions can work with them without having to use velocity to replicate the js code.

Thanks for your ideas.

--
Bernardo Arlandis Ma��
* http://berarma.webhop.org/
* http://mozilla.webhop.org/


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to