Skip to content

Instantly share code, notes, and snippets.

@claytical
Created September 19, 2019 19:28
Show Gist options
  • Save claytical/5c0fceb8764a180710af11a868f5cb3c to your computer and use it in GitHub Desktop.
Save claytical/5c0fceb8764a180710af11a868f5cb3c to your computer and use it in GitHub Desktop.
Get JSON Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>GetJSON Example</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
</script>
var big_set;
$.getJSON( "http://emuseum", function( data ) {
var items = [];
$.each( data, function( key, val ) {
var artwork = {"title": data.title,
"author": data.author
};
items.push(artwork);
});
big_set = items;
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment