Created
March 20, 2012 14:27
-
-
Save darrend/2136153 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
/* 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