Loading ...
Sorry, an error occurred while loading the content.

3781Re: [Cheetahtemplate-discuss] Placeholder bug?

Expand Messages
  • Shannon -jj Behrens
    Sep 1, 2006
    • 0 Attachment
      On 9/1/06, michelts <michelts@...> wrote:
      > Hi guys,
      >
      > I'm using cheetah with MochiKit and I have a problem in a template, I
      > want to write the following output:
      >
      > <script type="text/javascript"><!--
      > var obj1 = document.getElementById('obj1');
      > var obj2 = $('obj2');
      > --></script>
      >
      > The second line do the same as the first, the $(...) javascript
      > function is defined by MochiKit to be a link to
      > document.getElementById. My problem is that cheetah is not escaping
      > the dollar sign, I try the following template:
      >
      > <script type="text/javascript"><!--
      > var obj1 = document.getElementById('obj1');
      > var obj2 = $$('obj2');
      > var obj3 = $$\('obj3'\);
      > --></script>
      >
      > This renders to the following:
      >
      > <script type="text/javascript"><!--
      > var obj1 = document.getElementById('obj1');
      > var obj2 = $obj2;
      > var obj3 = $\('obj3'\);
      > --></script>
      >
      > I'm using Cheetah2.0-rc7. Is this a bug or am I doing something wrong?
      > Thanks.

      Heh, I was thinking of this problem the other day. I have three suggestions:

      o Get the JavaScript out of the HTML and use a static JavaScript file ;)

      o Create an alias for the $ function in JavaScript.

      o Use \$().

      Happy Hacking!
      -jj

      -------------------------------------------------------------------------
      Using Tomcat but need to do more? Need to support web services, security?
      Get stuff done quickly with pre-integrated technology to make your job easier
      Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
      http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Show all 6 messages in this topic