Know a great AI tool or AI news source? Submit it to AiByts

Inline rendering with document​.currentScript

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 <script> element that replaces itself when the page loads: The year is <script> document.currentScript.replaceWith(…

By Simon WillisonSimon Willison

Read the full story

Originally published by Simon Willison on Oct 17, 2026.

Read on Simon Willison(opens in a new tab)

Comments

Sign in to join the discussion.

No comments yet — be the first to share your thoughts.