Skip to content

Instantly share code, notes, and snippets.

@pk11
Created September 29, 2013 15:34
Show Gist options
  • Save pk11/6753488 to your computer and use it in GitHub Desktop.
Save pk11/6753488 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/>
</head>
<body>
<script data-model="rest">
var Server = function() { this.name = ''; };
</script>
<script data-model="push">
var Updates = function() { this.h = this.m = this.s = this.d = this.M = this.y = ''; };
</script>
<script data-type="Server" data-instance="server" data-url="data/name"></script>
<script data-type="Updates" data-instance="updates" data-url="push/time"></script>
<output class="time">Time: </output><output class="time">#{updates.h}:#{updates.m}:#{updates.s}</output><br>
<output class="time">Date: </output><output class="time">#{updates.y}-#{updates.M}-#{updates.d}</output><br>
<span id="output">Name: #{server.name}</span>
<input size="24" id="name" data-value="#{server.name}"/>
<button onclick="#{server.$put()}" id="set">Set</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment