Created
August 11, 2015 05:50
-
-
Save sou-hi/fd15573965ea3be46b00 to your computer and use it in GitHub Desktop.
jQuery-Mustacheというjs template enginを使ってみました ref: http://qiita.com/sou-hi/items/328fbf5a8cb37bbde9c0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- include js --> | |
| <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script> | |
| <script src="https://raw.github.com/jonnyreeves/jquery-Mustache/master/jquery.mustache.js"></script> | |
| <script src="https://raw.github.com/janl/mustache.js/master/mustache.js"></script> | |
| <!-- Templates in the DOM --> | |
| <script type="text/html" id="dom-template-a"> | |
| <p>Hello, {{name}}, did you know you can load templates direct from the DOM?</p> | |
| </script> | |
| <script type="text/javascript"> | |
| // Add all templates found in the DOM | |
| $.Mustache.addFromDom(); | |
| $("body").mustache('dom-template-a', { name: 'World' }); | |
| </script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment