Created
April 26, 2012 14:18
-
-
Save pure/2499908 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script src="http://github.com/pure/pure/raw/master/libs/pure.js"></script> | |
</head> | |
<body> | |
<div id="test"> | |
<span class="name"></span> - <span class="score"></span> | |
</div> | |
<script> | |
var data = { | |
name:'lemol', | |
score: 4, | |
addZero:function(){ | |
return '0' + this.score; | |
} | |
}, | |
dir = { | |
'.name':'name.toString', | |
'.score':'addZero' | |
}; | |
$('#test').render(data, dir); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK. Thanks.