[stringtemplate-interest] Conflict with jQuery's $

Bilal Bhatti hello at neelo.com
Tue Jun 17 20:31:03 PDT 2008


Hi,

I ran into the same issue. Escaping $ with \$ works but it is not an ideal
solution. Also, using <..> is even worse, as if you are using jQuery you are
probably in a webapp and then wouldn't that conflict with HTML tags?

I think the way ST delimits an expression could be better. Velocity doesn't
have any problem with expressions like these or using $ for jQuery. May be
it ST could ignore a single $ and only attempt to evaluate an expression
that has a closing $, like $.....$.

Thanks.

BTW: I really like ST :)

On Mon, Jun 16, 2008 at 2:30 AM, Terence Parr <parrt at cs.usfca.edu> wrote:

> hi. try \$ and also can use <...> delimiters :)
> Ter
> On Jun 16, 2008, at 3:08 AM, Jeyaram Gurusamy wrote:
>
> > Dear All,
> >
> > I am just starting with StringTemplate. I am afraid that it could
> > have been answered already but I wasn't able to search the
> > newsgroup archives.
> >
> > ST seems to conflict with jQuery's $. The following code
> >
> >    $("something").something
> >
> > throws this error
> >
> > action parse error in group mainGroup line 0; template context is
> > [context_name]
> > line 1:20: unexpected token: .
> >     at org.antlr.stringtemplate.language.ActionParser.action
> > (ActionParser.java:143)
> >     at org.antlr.stringtemplate.StringTemplate.parseAction
> > (StringTemplate.java:879)
> >
> > Is it a known problem? Is there a solution to it?
> >
> > I understand that we shall change jQuery's $ to something else as
> > it is just an alias to jQuery itself. But is there any other
> > solution without touching jQuery's $?
> >
> >
> > Thank you very much for your time.
> >
> > Regards
> > Jeyaram
> >
> >
> > _______________________________________________
> > stringtemplate-interest mailing list
> > stringtemplate-interest at antlr.org
> > http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20080617/0e7d196a/attachment.html 


More information about the stringtemplate-interest mailing list