Created
December 2, 2011 21:34
-
-
Save pure/1424926 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 PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; 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> | |
<span class="date1"></span> | |
</div> | |
<script> | |
var data = { | |
user:{ | |
name:"user name", | |
date1:"20010101", | |
date2:"19991225" | |
} | |
}, | |
dir = { | |
"span.date1":function(){ | |
return this.getYear( this.user.date1 ); | |
} | |
}; | |
data.getYear = function(e){ | |
return e.substring(0,4); | |
}; | |
$("div").render(data, dir); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment