On Dec 1, 2007 10:16 AM, David Terk <[EMAIL PROTECTED]> wrote:
> Hey folks,
>
> I have a question regarding the use of javascript and macros.  Today a lot
> of javascript libraries have script such as $(element...) in order to grab
> specific HTML elements.  Based on what I have read in the VTL reference it
> looks like this would be ignored by the engine and rendered as standard
> text.  I am hoping that someone could confirm this.

$(element) would definitely be ignored, since it is not a Velocity
reference.  Velocity references are either $element or ${element}.
Even if it were a proper reference, Velocity would only replace it
with another value if you put a value with the key "element" into your
context before rendering.

> Additionally, perhaps someone could point out some potential problems (if
> any) when using Velocity Macros to render Javascript.

Javascript and Velocity are fairly different syntaxes.  They are also
very different in that Velocity is processed server side, whereas
javascript is processed client side.   I haven't heard of many people
complaining of problems generating javascript with Velocity.  If you
have problems where Velocity isn't generating your javascript code as
you expect, feel free to ask on this list and we'll help you get it
sorted out.

> Thanks,
>
> Dave
>

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

Reply via email to