Skip to content

Instantly share code, notes, and snippets.

@billyboozer
Created August 25, 2014 20:05
Show Gist options
  • Save billyboozer/e6cd0884abead2b628e4 to your computer and use it in GitHub Desktop.
Save billyboozer/e6cd0884abead2b628e4 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://builds.emberjs.com.s3.amazonaws.com/tags/v1.0.0/ember.js"></script>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
$.getJSON( "https://sports-feed.firebaseio.com/sports/stories.json", function( data ) {
var items = [];
$.each( data, function( key, val) {
items.unshift( "<li id='" + key + "'><b>"+ val.user__screen_name +":</b><br>" + val.text + "</li><br>" );
});
console.log(items.length);
$( "<ul/>", {
"class": "my-new-list",
html: items.join( "" )
}).appendTo( "body" );
});
</script>
</body>
</html>
$.getJSON( "https://sports-feed.firebaseio.com/sports/stories.json", function( data ) {
var items = [];
$.each( data, function( key, val) {
items.unshift( "<li id='" + key + "'><b>"+ val.user__screen_name +":</b><br>" + val.text + "</li><br>" );
});
console.log(items.length);
$( "<ul/>", {
"class": "my-new-list",
html: items.join( "" )
}).appendTo( "body" );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment