Skip to content

Instantly share code, notes, and snippets.

@darrend
Created March 20, 2012 14:27
Show Gist options
  • Save darrend/2136153 to your computer and use it in GitHub Desktop.
Save darrend/2136153 to your computer and use it in GitHub Desktop.
/* Author: Darren Day
*/
function handleResponse(data) {
var source = $("#template").html();
var template = Handlebars.compile(source);
var result = template({
"links": data
});
$("#main").append(result);
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
}
function refreshSessions() {
$.ajax({
url: "http://winaspectreapi.appspot.com/api/sessions",
dataType: 'jsonp',
success: handleResponse
});
}
$(document).ready(function() {
refreshSessions();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment