Created
September 19, 2019 19:28
-
-
Save claytical/5c0fceb8764a180710af11a868f5cb3c to your computer and use it in GitHub Desktop.
Get JSON Example
This file contains hidden or 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
<!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