kimjoar / writings

My blog posts
1.99k stars 121 forks source link

Use HTML template #10

Open troythewolfe opened 11 years ago

troythewolfe commented 11 years ago

In this example, doing html generation via JS seems ok because there is so little of it, but in a larger project, something like mustache (or even the _ template) becomes much more necessary. It might be worth making use of templates in the this tutorial.

pcottle commented 11 years ago

I'd also like to see this -- this tutorial is absolutely great, but when I moved on to my own project I was confused at first how to store templates in the document.

Just a simple demonstration of embedding a template via a <script> tag and then grabbing it back out via jQuery would be nice.

kimjoar commented 11 years ago

@troythewolfe @pcottle I absolutely agree. There are many other "patterns" I wanted to include, but felt would complicate the blog post. I'm working on some follow-ups, but just haven't had the available time to finish them. (I'm fairly sure that there will be another blog post in late december or early january that will use the same process as this blog post to explain how templates can be included. I could just include them in a <script> tag, but I'm not fond of that solution as it makes testing difficult. Hopefully I have the time soon.)

Thanks for your feedback, guys!