Skip to content

Instantly share code, notes, and snippets.

@pure
Created March 13, 2011 14:48
Show Gist options
  • Save pure/868143 to your computer and use it in GitHub Desktop.
Save pure/868143 to your computer and use it in GitHub Desktop.
<!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>
<form>
<div class="field">
<label><input autocomplete="off" /></label>
</div>
</form>
<script type="text/javascript">
var dataset = {
Fields: {
"User_Name": {
"FieldName": "User_Name",
"Caption": "User Name",
"Type": "text"
},
"Password": {
"FieldName": "Password",
"Caption": "Password",
"Type": "password"
}
}
},
directives = {
"div.field": {
"field <- Fields": {
"+label": "field.Caption",
"input@id": "field.FieldName",
"input@type": "field.Type"
}
}
};
$('form').render(dataset, directives);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment