aktuelle.kurse/m133/4_Modulinhalte_und_Uebungen/07-JQuery-skript/07-jQueryLoesungen/Beispiel1.html
Harald G. Mueller 28ff49e098 muh
2023-06-29 07:50:41 +02: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>