<!DOCTYPE html>
<html>
<head>
<script data-require="yui@3.3.0" data-semver="3.3.0" src="//cdnjs.cloudflare.com/ajax/libs/yui/3.3.0/yui-min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<input type="button" id="btnGetGitHubItems" value="Get Items"/>
</br>
<div id="out">
</div>
</body>
</html>
YUI().use('node', 'event', 'jsonp', function(Y) {
var url = "https://api.github.com/users/jwood803?callback={callback}";
var template = // assignment continued below
'<table>' +
'<caption>GitHub user <code>{login}</code> ({name})</caption>' +
'<thead>' +
'<tr>' +
'<th>Repositories</th>' +
'<th>Gists</th>' +
'<th>Followers</th>' +
'<th>Following</th>' +
'<th>URL</th>' +
'</tr>' +
'</thead>' +
'<tbody>' +
'<tr>' +
'<td>{public_repos}</td>' +
'<td>{public_gists}</td>' +
'<td>{followers}</td>' +
'<td>{following}</td>' +
'<td><a href="{blog}"/>Blog</td>' +
'</tr>' +
'</tbody>' +
'</table>';
Y.one("#btnGetGitHubItems").on("click", function(e) {
Y.jsonp(url, handleJsonpResponse);
});
function handleJsonpResponse(response) {
Y.one("#out").append(Y.Lang.sub(template, response.data));
}
});