velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: Using jQuery with Velocity
Date Wed, 08 Jul 2009 20:00:58 GMT
If your Velocity template has jQuery javascript (or any other lib that
offers the $ symbol as a shortcut), then i would recommend just not
using the shortcut symbol.  Just use the jQuery variable.  Or if you
really don't want to type six letters, then do:

var J = jQuery;

and use J instead of $. When two syntaxes are close like that, i would
argue that the more maintainable, readable solution is to avoid mixing
them, wherever possible.  But if you really must mix them, then yes,
use the EscapeTool ($esc) or just do:

context.put("D", "$");

and use ${D} instead of ${esc.d}.

But do try to avoid mixing similar syntaxes when an easy alternative
is available.

On Wed, Jul 8, 2009 at 11:50 AM, John Eichelsdorfer<jeichels@yahoo.com> wrote:
>
> In attempting to integrate the JQuery UI datepicker tool into our site
> http://jobbank.com/ http://jobbank.com/ , we are having an issue where the
> jQuery code is being removed due to both projects using the "$" symbol.
>
> jQuery has this link:
> http://docs.jquery.com/Using_jQuery_with_Other_Libraries
> http://docs.jquery.com/Using_jQuery_with_Other_Libraries  that describes how
> to modify the use of jQuery to attempt to get things working, but do you
> have a preferred solution?   Examples would be great if you have them.
>
> Thank!
>
> John
>
>
> -----
> John Eichelsdorfer
>
> http://jobbank.com/ jobbank.com
> --
> View this message in context: http://www.nabble.com/Using-jQuery-with-Velocity-tp24397241p24397241.html
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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


Mime
View raw message