Skip to content

Instantly share code, notes, and snippets.

@xkef
Created January 15, 2020 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xkef/30c8d4ec29ebbc5d02ed03c49bfbdcad to your computer and use it in GitHub Desktop.
Save xkef/30c8d4ec29ebbc5d02ed03c49bfbdcad to your computer and use it in GitHub Desktop.
xkcd
<html>
<script>
var x = document.createElement("IMG");
fetch("https://xkcd.now.sh/?comic=2254")
.then(res => res.json())
.then(({ img }) => {
x.setAttribute("src", img);
document.body.appendChild(x);
})
.catch(e => console.log(e));
</script>
<body></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment