Skip to content

Instantly share code, notes, and snippets.

@evantahler
Created May 14, 2014 04:36
Show Gist options
  • Save evantahler/823996078bc80d1c7d60 to your computer and use it in GitHub Desktop.
Save evantahler/823996078bc80d1c7d60 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
var doRequest = function(action){
$.get('/api/' + action, function(data){
$('#container').append(JSON.stringify(data))
$('#container').append('<hr />');
});
};
setInterval(doRequest, 1000, 'randomNumber');
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment