aktuelle.kurse/m133/Modul_Unterlagen_133_VOR/01-Modulinhalte/07 Script (JQuery)/07 jQuery Lösungen/Beispiel1.html
Harald G. Mueller cdff097ef7 muh
2022-03-17 11:19:26 +01:00

38 lines
859 B
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery.getJSON demo</title>
<style>
img {
height: 100px;
float: left;
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script>
(function() {
var flickerAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";
$.getJSON( flickerAPI, {
tags: "mount rainier",
tagmode: "any",
format: "json"
})
.done(function( data ) {
$.each( data.items, function( i, item ) {
$( "<img>" ).attr( "src", item.media.m ).appendTo( "#images" );
if ( i === 3 ) {
return false;
}
});
});
})();
</script>
</head>
<body>
<div id="images"></div>
</body>
</html>