Open SourceSimon Willison

Inline rendering with document​.currentScript

#javascript#inline rendering#web development

English

Simon Willison discusses an innovative technique using the document.currentScript property for inline rendering in JavaScript. This method allows developers to create a small inline script that can replace itself with the current year, effectively serving as a mini template language.

中文

西蒙·威利森讨论了一种使用document.currentScript属性进行内联渲染的创新技术。此方法允许开发者创建一个小的内联脚本,该脚本可以用当前年份替换自身,从而有效地充当迷你模板语言。