发生了什么
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> Tags: javascript
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> Tags: javascript
为什么重要
需要你自己点开原文确认一次,这里给的是摘要与判断。
需要你自己点开原文确认一次,这里给的是摘要与判断。
跟你有什么关系
暂无明确落点,仅作存档。
暂无明确落点,仅作存档。
以上判断为规则生成的初稿,发布前请润色。
判定理由
评分 0 / 100