# Inline rendering with document​.currentScript — retained record

> Retained news record from news:feed-3733c65b9abe07b4.

Canonical: https://highsignal.app/data/records/9bfd1d80935f43a6

[← sources](https://highsignal.app/data)


source: [news](https://highsignal.app/data/news) (news:feed-3733c65b9abe07b4)  published 2026-10-17 21:11 ingested 2026-10-23 20:32

[original source ↗](https://simonwillison.net/2026/Oct/17/document-currentscript/)

## retained text



```
17th October 2026 - Link Blog
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(
  new Date().getFullYear())</script>
If you define a shortcut function like this:
$=(...n)=>document.currentScript.replaceWith(...n)
You get a tiny template language:
The year is <script>$(new Date().getFullYear())</script>
Recent articles
- Battle Drones - a vibe coded RTS with audio-based multiplayer - 20th October 2026
- Hello Python 3.15, goodbye 3.10, and now I can use 3.11 - 12th October 2026
- A new feature for my blog, built using my voice - 9th October 2026
- Claude Haiku 5.5 - 7th October 2026
```



document fetched 2026-10-24 11:27 · canonical https://simonwillison.net/2026/Oct/17/document-currentscript
