Skip to content

Instantly share code, notes, and snippets.

@AnSavvides
Created March 19, 2016 16:13
Show Gist options
  • Save AnSavvides/8d82f7c9430f61b4a0ea to your computer and use it in GitHub Desktop.
Save AnSavvides/8d82f7c9430f61b4a0ea to your computer and use it in GitHub Desktop.
<style>
#browser { padding: 20px; }
img { width: 100px; height: 100px; float: left; }
</style>
<h1>THE CATS</h1>
<button>Pls give me a cat</button>
<div id="cats"></div>
<script>
var catURL = 'http://thecatapi.com/api/images/get?format=src&type=gif';
$('button').click(function() {
$('#cats').append(
$('<img/>').attr('src', catURL + '&' + new Date().getTime())
);
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment