如何在我的网页上显示生态模板?
我最近开始学习如何创建网页,并且需要学习生态模板的帮助。我正在尝试在网页上的模板中显示数据。这是正文中我的脚本标记中的代码行的示例:
<script src="http://jashkenas.github.com/coffee-script/extras/coffee-script.js"></script>
<script src="http://sstephenson.github.com/eco/dist/eco.js"></script>
<script>
eco.render "<p><%- @word %></p>", {word: "hey"}
</script>
但是,我收到一条错误消息,指出“在语句之前缺少 ;”。我需要做什么才能让它显示在我的页面上?
I've recently started learning how to create webpages and I need help learning Eco Templates. I am trying to display data in a template on my webpage. This is an example of the line of code in my script tags in the body:
<script src="http://jashkenas.github.com/coffee-script/extras/coffee-script.js"></script>
<script src="http://sstephenson.github.com/eco/dist/eco.js"></script>
<script>
eco.render "<p><%- @word %></p>", {word: "hey"}
</script>
However, I get an error that says "Missing ; before statement". What do I need to do to get this to display on my page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要将 type="text/coffeescript" 添加到您的脚本标记中,以便 Coffeescript 库来编译客户端吗?
Don't you need to add type="text/coffeescript" to your script tag for the coffeescript library to compile client side?