jQuery Templates Continued

I've done some more work on my jQuery Templates proposal. First, by request from some on the jQuery lists I've removed the usage of the $.ui namespace, although it really functioned completely independent of jQuery.UI. Second, I've added a modification to override the jQuery domManip() method, which is a method called by other methods like insertBefore() and append() and handle DOM manipulation within the jQuery core. Now, you can pass any of the manipulation methods your jQuery Template object and as a second parameter the object of properties for replacement. This changes the syntax to:

var t = $.template('
Hello ${name}, how are you ${question}? I am ${me:substr(0,10)}
'); $(selector).append( t , { name: 'Stan', question: 'feeling', me: 'doing quite well myself, thank you very much!' });

I'm going to resubmit my proposal to jquery-en and jquery-ui for consideration and review. If you're interested in looking at the code, it's available at:
http://stanlemon.net/files/jquery.template.js

Post Comment:

Comments are now closed.

Copyright © 2002-2010 Stan Lemon | Design by: styleshout