Simon Willison

Inline rendering with document​.currentScript

· 6小时前
AI 摘要

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 If you define a shortcut function like this: $=(...n)=>document.currentScript.replaceWith(...n) You get a tiny template language: The year is Tags: javascript

查看原文(Simon Willison)