【发布时间】:2014-02-04 12:28:33
【问题描述】:
我正在尝试在包含 javascript 之后执行 = yield :javascript
所以我在 html 中有这样的东西:
<body>
<!-- my actual = yield :javascript of javascript calling my js codes -->
<script type="text/javascript">//my-js-code</script>
<!-- javascript include tag that contains jQuery -->
<script type="text/javascript" src="path/to/jquery"></script>
</body>
所以在我的 index.html.haml 中,我的 javascript 产量需要放在 jQuery 的这个包含之后,问题是我无法访问这个 jquery 的包含,我需要类似的东西this: "选择这个 javascript 的 yield 并放在包含和 id 的 script 标签后面,例如"
有人可以帮忙吗?
Obs:我正在使用 rails 4、ruby 2 和 haml
【问题讨论】:
-
为什么不能简单地把 include :javascript 放在 jquery 的下面?
标签: javascript jquery ruby-on-rails haml