Skip to main content
100%

Dragon Trainer Monthly - XSS

✓ Published0🌍 Public
Aangusgrant
Last edited Nov 5, 2022
Created on Nov 5, 2022

This example shows a magazine-style article feed titled “Dragon Trainer Monthly,” displaying fetched articles and author bios in a clean, single-column layout. It demonstrates client-side HTML sanitization to prevent cross-site scripting (XSS) attacks. The code uses the Fetch API with `Promise.all` to load article and author JSON data from two external URLs, then renders the content via `innerHTML` after passing it through a `cleanHTML` function that strips `<script>` tags and removes dangerous attributes like `on*` handlers and `javascript:` URLs.

AI-generated description

Similar vizzes