I’m trying to learn how to use jQuery templates using this old ScottGu’s blog post:
And the plugin from here:
https://github.com/jquery/jquery-tmpl/blob/master/jquery.tmpl.min.js
But either I’m doing something wrong, or this article isn’t relevant anymore.
Could you show me a better and up-to-date one?
I wrote a blog post about jQuery templates a week or so ago. There’s no special magic in getting it to work with MVC – just make sure you’re returning a JSON/XML object and are referencing the correct data and it’s all straightforward. You should check to make sure your templates are matching up with the data being returned by your controller method.
From your comment above it actually sounds like your issue lies in referencing the
jquery-tmplfile before you reference thejqueryfile in your header.