ai newsSo., 18. Okt.
EilmeldungClaude Code 2.1.302 Flips Two claude -p Defaults: Permission Mode and Fork Subagents

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

Simon WillisonSamstag 23:11 · 17.10.1 Min. Lesezeit

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>

This is a link post by Simon Willison, posted on 17th October 2026.

Sponsor me for $10/month and get a curated email digest of the month's most important LLM developments.

Quelle: Simon Willison (Simon Willison). Original öffnen