在以下Slim代码段中,我们如何将id / type属性添加到head标签中的javascript标签(类似于html中的script标签)。
Slim docs除了简单的警报语句外,没有显示如何执行此操作。
P.S。代码简明扼要
doctype html
html
head
title
| Example
<!-- How to add script id and type in the following code? -->
javascript:
alert('Slim supports embedded javascript!')
body
#root
答案 0 :(得分:0)
根据您发布的docs link,您可以简单地内嵌脚本标签:
apple
答案 1 :(得分:0)
经过研究并从各处获取信息后,我找到了上述答案的替代方法。
doctype html
html
head
title
| Example
script#ID_HERE type="text/javascript"
| JS CODE
body
#root