Extras

This page contains "extras" as required for the WD4E capstone. These extras demonstrate advanced web features.

OpenWeatherMap API Demo

The following demonstrates embedding content from a web service using an API to get information from the service and rendering it on this page. I have used OpenWeatherMap to get the current weather forecast for Singapore.

Note: I'm exposing my API key here, and I'm rate-limited so please don't spam it. A proper site with a backend will keep the API keys in the backend and not expose them to the end-user like this.

Cookie Demo

The following demonstrates storing and retrieving data from a cookie installed locally on the viewer's machine. Type something into the text box and hit "Submit". Whatever you typed will appear in an alert window.

Note: Cookies like this don't work in MS Edge or Chrome. They may not work in Codepen at all. I'm looking into it, but I've tested this in Mozilla Firefox and it works there.