I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
javascript: (function($) { | |
var bookmarklet = document.getElementById( | |
'DELI_save_link_slidedown'); | |
if (bookmarklet) { | |
$('#DELI_mist').show(); | |
$('#DELI_save_link_slidedown').slideDown('normal'); | |
return | |
}; | |
if (!window.jQuery) { | |
node = document.createElement('SCRIPT'); |
(tl;dr DOM builders like [domo][domo] trump HTML templates on the client.)
Like all web developers, I've used a lot of template engines. Like most, I've also written a few of them, some of which even [fit in a tweet][140].
The first open-source code I ever wrote was also one of the the first template engines for node.js, [a port][node-tmpl] of the mother of all JavaScript template engines, [John Resig][jresig]'s [micro-templates][tmpl]. Of course, these days you can't swing a dead cat without hitting a template engine; one in eight packages on npm ([2,220][npm templates] of 16,226 as of 10/19) involve templates.
John's implementation has since evolved and [lives on in Underscore.js][underscore], which means it's the default choice for templating in Backbone.js. And for a while, it's all I would ever use when building a client-side app.
But I can't really see the value in client-side HTML templates anymore.