ReleasesOct 18, 2026 · 04:111 source

Inline rendering with document​.currentScript

From simonwillison.net

AI;DR

Lean Rada demonstrated a technique using the document.currentScript property to enable inline rendering in JavaScript, allowing a small inline script element to replace itself on page load with dynamic content such as the current year. A shortcut function can be defined to create a minimal template language for inserting values directly within HTML.

Read the sourceSign in to suggest

Sources

One ranked edition, every morning

The stories that matter today. Free, cancel anytime.

Telegram @aidr_today