aktuelle.kurse/oldies/m133/4_Modulinhalte_und_Uebungen/07-JQuery-skript/07-jQueryLoesungen/Beispiel1.html

38 lines
859 B
HTML
Raw Normal View History

2022-02-24 09:37:43 +01:00
<!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>