Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1172 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Javascript dollar functions break kid.

Reported by: italomaia Owned by: anonymous
Priority: normal Milestone: 1.5
Component: Kid Version: 1.0b1
Severity: normal Keywords:
Cc:

Description

If you try something like this in your kid template, it will break:

<![CDATA[ var $E = function(){} ]]>

And, "Why is this a problem that deserves my precious attention?", you say. Well, mootools has two functions that break with kid, they are $E and $S.

Change History

comment:1 Changed 13 years ago by plewis

Does a double dollar sign work? i.e.

<![CDATA[ var $$E = function(){} ]]>

comment:2 Changed 13 years ago by italomaia

Yes, it this works. Seems like $$ is interpreted as $. Even though, it doesn't seems right.

comment:3 Changed 13 years ago by plewis

Kid uses $$ as an escape sequence for the $ character, as the $ can be used to refer to kid variables, and without the escape, kid thinks you are looking for a variable named E

 http://kid-templating.org/language.html#identifier-shortcut-name  http://kid-templating.org/language.html#escaping

Unless you object, I think this ticket can be closed.

comment:4 Changed 12 years ago by alberto

  • Milestone changed from 1.0b3 to 1.1

comment:5 Changed 12 years ago by jorge.vargas

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.