有点像……
This Header Info One
This content one. . .
This Header Info Two
This content two. . .
…并使用jQuery根据当今标准中的选择器良好实践交换内容?
我正在使用脚本类型=“text / html”…来允许动态更改我的内容,并找到许多方法来执行此操作.是否有一个来源可以解释这种方向以及是否有任何标准化的做法.
我看到像……的代码
…嵌套在脚本类型=“text / html”标签中,真的不知道为什么它是这样编写的.也只是在主干上弄湿我的喙,如果只是想在一个页面中添加内容交换,这看起来有点沉重.
解决方法:
根据HTML5 spec for the script tag,使用< script>完全没问题.将type属性设置为任何有效的MIME类型.这包括MIME类型,如text / html或text / plain.
“There are two types of scripts authors may attach to an HTML
document: Those that are executed one time when the document is loaded
[and t]hose that are executed every time a specific event occurs”
你不需要骨架来进行模板化.你可以用例如jQuery或我个人最喜欢的,Mustache.js.
标签:javascript,css,html5,templates
来源: https://codeday.me/bug/20190928/1827072.html