I've modified the plugin slightly.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd";>
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>Templating</title>
    <script src="../../jquery/dist/jquery.min.js"></script>
    <script src="jquery.templating.js"></script>
    <script>
      jQuery(function ($) {
          $("a.updateTemplate").click(function() {
            $(this.rel).loadTemplate(this.href);
            return false;
          });
          $("._template").templatize();
      });
    </script>
  </head>
  <body>
    <div class="_template" id="myTemplate">
      <![CDATA[
        <{{tag}} href="{{href}}">{{first}} {{last}}</{{tag}}>
        <p>Bar</p>
        <div>First Name: {{first}}</div>
        <div>Last Name: {{last}}</div>
      ]]>
    </div>
    <a href="foo" rel="#myTemplate" class="updateTemplate">Click</a>
  </body>
</html>

Effectively, you stick the template in a CDATA block, and it can then be
converted in the same way I described earlier. Cool shit, huh?

On 8/18/07, Sean Catchpole <[EMAIL PROTECTED]> wrote:
>
> Pretty cool Yehuda, I'll have to give it a shot so I can give ya some
> feedback.
>
> ~Sean
>



-- 
Yehuda Katz
Web Developer | Procore Technologies
(ph)  718.877.1325

Reply via email to