Welcome To Snipplr

Everyone's Recent JavaScript Snippets Tagged template

« Prev 1 Next »
From @blixt http://stackoverflow.com/users/119081/blixt As you can see, the classes correctly interact with each other (they share the static id from MyClass, the announce method uses the correct get_name method, etc.) One thing to note is the...
1 112 posted 6 years ago by rickygri
Uses the object prototype to extend data. Instantiate as an object and use as specified below (bottom of the code)
0 84 posted 6 years ago by rickygri
For those moments of weakness when .replace() looks like a good idea...
0 84 posted 7 years ago by inreflection7
jsHint happy class template for javascript
1 92 posted 7 years ago by XtreamIT
"Javascript module pattern emulates the concept of classes in such a way that we're able to include both public/private methods and variables inside a single object, thus shielding/namespacing particular parts from the global scope." When inheritanc...
0 77 posted 9 years ago by coprolit
Most of spservices function can be ignored -- not specifically relevant to templating. Important code in that block is the array push.
0 56 posted 9 years ago by rumremix
0 42 posted 9 years ago by loric
All glory to the ml function.
0 74 posted 9 years ago by pablo_PXL
*String template (String template, Object data)* Usage: template('Hello <b>${name}!</b> (not ${name}?)', { name: 'Gandalf' }) Result: Hello <b>Gandalf!</b> (not Gandalf?)
0 46 posted 9 years ago by emdin
Simple template for setting up classes in JS
0 69 posted 10 years ago by geekyjohn
I made this class because is was fed up with all those strings with escaped quotes with when building html into an output-string. You could also build a php-version of it.
0 53 posted 11 years ago by leonardreinders
Simple templating for innerHTML functions. Parses an input string (tmpl) for %(NAME) tokens, accepts an object (ns) as data and returns an output string.
1 66 posted 13 years ago by mattgay
this is the template i mostly use when create new js files
2 65 posted 13 years ago by alvaroisorna
« Prev 1 Next »