Re: parse

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Wednesday, January 6, 2010, 8:14:28 AM, Leos Literak wrote:

> Hi,
>
> I have following expression:
>
>
>      <@lib.addFormField true, "Login", "Přihlašovací jméno (login) musí
být unikátní">>
>           <@lib.addInputBare "login", 24" />
>           <script type="text/javascript">
>              $(document).ready(function() {
>                 $("#login").change(function() {
>                   new Ajax.Updater('loginError', '/ajax/checkLogin', 
> {parameters: { value : $F('login')}})
>                 });
>               });
>           </script>
>      </@lib.addFormField>
>
> The issue is that following jquery expression is being parsed by 
> freemarker: $("#login")
>
> TokenMgrError: Lexical error at line 32, column 19. Encountered: "#" 
> (35), after : "" in web/add/user.ftl
>
> I tried to surround it with <#noparse> but it has no effect (freemarker
> 2.3.13). I tried to escape it with backslash without luck. What to do?

There is a typo in your template, which leads to this otherwise not
too correct error message: you have a " after the 24 parameter, which,
it seems, starts a string literal (and that's incorrect, as it should
be a parsing error immediately) that is closed by the " before the #,
and then you have a parameter expression that starts with #, which
causes the parsing error you get.

> Thanks
>
> Leos

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.