Created
January 2, 2014 04:59
-
-
Save sytelus/8215246 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-latest.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<textarea id="n1"></textarea> | |
<br/> | |
<textarea id="n2"></textarea> | |
</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 tmpl = Handlebars.compile("{{name}} {{name2}}{{{name}}}"), | |
name = new Handlebars.SafeString("<p>abc\nxyz</p>"), | |
name2= "<p>abc\nxyz</p>" | |
; | |
$('#n1').val( tmpl({ name: name }) ); | |
$('#n2').val( tmpl({ name2: name2 }) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment