Interesting that you had problems in IE. We've been using it for some IE6-specific stuff for a while with no problems, FWIW. Even though the project doesn't see much action, we haven't noticed any bugs (with a lot of heavy use) and there haven't been any features we wish the author would get around to adding. Basically, it's just been doing it's job as is, which has been fine.

Sounds like you have a nice thing going on with your jtemplates implementation. We created something similar for trimpath templates, so that we can set an array of template filenames (in js) to load, fetch them all into a client side cache, then bind them to json data (which they do natively) via a one-liner, too. Subsequent calls use the templates from the cache.

We're also using asp.net for the web service end of things, but via ashx files (HttpHandler) that inherit from a custom JSONHandler base that we created using jayrock:

http://jayrock.berlios.de/

The HttpHandler allows us to $.post js vars directly or use $.getJSON directly to access services exposed via the ashx files and have them return json data. An example post and trimpath template call, this calls a GetAccount web service in Account.ashx, passing in ihwy_member.accountID, which is converted to the correct .net datatype via the handler's base class, using reflection on the web service's method signature: (yeah, reflection has a little overhead, but minimal concern in our cases):

$.post('../Services/Account.ashx?GetAccount&v=' + ihwy_base.now(), {accountID:ihwy_member.accountID}, function(data){ $('#accountEditWidget').html( TrimPath.parseTemplate( ihwy_member.templates['accountEdit'] ).process( {data:data.account} ) );
   // do some stuff...
}, 'json');

The data returned from the $.post is json data, and the .account node of the json tree is pumped into the template via the data:data.account declaration. The templates can have any js data passed in, json works nicely for loops and such.

Anyway, thought you might be interested. Looks like the jtemplates site is still down, alas. I'd like to give it another look. IIRC, the folks making that were also creating an MVC framework for js. Is that the same folks? Maybe they're in stealth mode while prepping a big launch? (we can hope...!)

Jack

Half-Dead wrote:
Yes i've come across that one, tho it seems to not be maintained
anymore since a long time, and i had some problemes in the way i
wanted to use it with IE (as usual..)

Main reason i really like jtemplates is because i am very happy with
jquery and managed to wrap all of jtemplates functionality into
jquery, so i can do something like $("#div").BindTemplate(jsonData,
callBack);, where it will go fetch a file called "div.aspx" in a
templates folder via httpGet and then apply the json data to the
template, while putting the fetched template into a user-side cache.

Works like a charm on a chat with thousands of simultaneous users :)


..now i just need to get rid of old Ajax.Pro and replace it with a
simple asmx scriptservice so we can use jquery for the client-server
communication part too.

-
Robert



Reply via email to