Created
June 6, 2014 01:49
-
-
Save mgroves/fc9c787fbb94bc4e814a to your computer and use it in GitHub Desktop.
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
| <script src="~/Scripts/jquery.js" type="text/javascript"></script> | |
| <script src="~/Scripts/doT.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| var template = $("#my-dot-template"); | |
| var dotted = doT.template(template.html()); | |
| // I'm building up an object here with literals | |
| // but typically this data would be returned by an ajax request | |
| var data = {}; | |
| data.Name = "Matthew D. Groves"; | |
| data.City = "Funkytown, USA"; | |
| data.ShoeSize = 13; | |
| $("#output").html(dotted(data)); | |
| }); | |
| </script> | |
| <div id="output"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment