Created
February 4, 2014 16:49
-
-
Save rahmanusta/8807561 to your computer and use it in GitHub Desktop.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script> | |
<meta name="description" content="Handlebars Basic" /> | |
<meta charset=utf-8 /> | |
<title>Handlebars Basic</title> | |
</head> | |
<body> | |
<script id="book" type="text/x-handlebars-template"> | |
<div class="panel panel-primary"> | |
<div class="panel-body"> | |
<p>{{name}}</p> | |
<p>{{author}}</p> | |
<p>{{price}}</p> | |
</div> | |
</div> | |
</script> | |
</body> | |
</html> |
This file contains 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
var book = {}; | |
book.name="Java ve Yazılım Tasarımı"; | |
book.author="Altuğ B. Altıntaş"; | |
book.price=34; | |
var template = $("#book").html(); | |
var compiled = Handlebars.compile(template); | |
var result = compiled(book); | |
$("body").append(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment