← Back to feed Fashion & Style

Inline rendering with document​.currentScript

Simon Willison 17 October 2026 9h ago
Inline rendering with document​.currentScript
57
Relevance
3/25
Freshness
25/25
Authority
18/20
Brand Signal
5/15
Depth
6/15
Relevance Freshness Authority Brand Depth
Inline rendering with document​.currentScript Lean Rada describes a neat trick that takes advantage of the document.currentScript property. You can use that to drop in a tiny inline element that replaces itself when the page loads: The year is document.currentScript.replaceWith( new Date().getFullYear()) If you define a shortcut function like this: $=(...n)=>document.currentScript.replaceWith(...n
Read Full Article → Simon Willison ↗