【问题标题】:What does this syntax pertain to in Railscast JQuery Upload tutorial此语法在 Railscast JQuery 上传教程中与什么有关
【发布时间】:2014-02-17 16:20:29
【问题描述】:

观看用于 JQuery 文件上传的 railscast 我在浏览源代码时遇到了这个脚本,但我不确定它到底是什么:

绘画 index.html.erb:

<script id="template-upload" type="text/x-tmpl">
<div class="upload">
  {%=o.name%}
  <div class="progress"><div class="bar" style="width: 0%"></div></div>
</div>
</script>

我主要对{%=.name%} 语法是什么感到困惑......

完整的源代码可以在这里找到: https://github.com/railscasts/381-jquery-file-upload/blob/master/gallery-after/app/views/paintings/index.html.erb

【问题讨论】:

    标签: javascript jquery ruby-on-rails ruby file-upload


    【解决方案1】:

    他使用的是JavaScript-Templates,因此使用了语法。此外,这另一个SO question 解释了text/x-tmpl 部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-04
      • 1970-01-01
      • 2014-05-09
      • 2016-09-16
      • 2013-01-18
      相关资源
      最近更新 更多