Skip to main content
100%

Get random Marvel character

✓ Published0🌍 Public
RRestuta
Last edited Jul 20, 2015
Created on Jul 20, 2015

This example fetches a random Marvel character from the Marvel Comics API and displays that character’s thumbnail in a pop-up window. It first selects a random offset between 1 and 1,485, then queries the API’s character endpoint with a limit of one. After retrieving the initial result, the code makes a second request to the character’s resource URI to get the full name and image path. Using jQuery’s `$.get` promises, it constructs the image URL at the `standard_fantastic` size and opens it via `window.open`. The data source is the live Marvel API.

AI-generated description

Similar vizzes