1. <tfoot id='tmaxU'></tfoot>
    • <bdo id='tmaxU'></bdo><ul id='tmaxU'></ul>
    <i id='tmaxU'><tr id='tmaxU'><dt id='tmaxU'><q id='tmaxU'><span id='tmaxU'><b id='tmaxU'><form id='tmaxU'><ins id='tmaxU'></ins><ul id='tmaxU'></ul><sub id='tmaxU'></sub></form><legend id='tmaxU'></legend><bdo id='tmaxU'><pre id='tmaxU'><center id='tmaxU'></center></pre></bdo></b><th id='tmaxU'></th></span></q></dt></tr></i><div id='tmaxU'><tfoot id='tmaxU'></tfoot><dl id='tmaxU'><fieldset id='tmaxU'></fieldset></dl></div>

      <small id='tmaxU'></small><noframes id='tmaxU'>

    1. <legend id='tmaxU'><style id='tmaxU'><dir id='tmaxU'><q id='tmaxU'></q></dir></style></legend>

      在没有咖啡脚本的 Rails 3.2 中使用 javascript

      时间:2024-04-19

      <legend id='o95NV'><style id='o95NV'><dir id='o95NV'><q id='o95NV'></q></dir></style></legend>
        <tbody id='o95NV'></tbody>
        1. <i id='o95NV'><tr id='o95NV'><dt id='o95NV'><q id='o95NV'><span id='o95NV'><b id='o95NV'><form id='o95NV'><ins id='o95NV'></ins><ul id='o95NV'></ul><sub id='o95NV'></sub></form><legend id='o95NV'></legend><bdo id='o95NV'><pre id='o95NV'><center id='o95NV'></center></pre></bdo></b><th id='o95NV'></th></span></q></dt></tr></i><div id='o95NV'><tfoot id='o95NV'></tfoot><dl id='o95NV'><fieldset id='o95NV'></fieldset></dl></div>

              <tfoot id='o95NV'></tfoot>

              <small id='o95NV'></small><noframes id='o95NV'>

                <bdo id='o95NV'></bdo><ul id='o95NV'></ul>

                本文介绍了在没有咖啡脚本的 Rails 3.2 中使用 javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                I'm using Rails 3.2, It's set up for coffeescript. I know Coffeescript is an awesome language and it's not too hard to learn, but i'm JUST starting to wrap my head around Javascript and jQuery. So my question is this: Is there an easy way to set rails 3.2 up to use Javascript instead? At the moment, my jQuery is in <script></script> tags in my view (timeline/index.html.erb). I'd like to move it into a .js file. I tried changing the name of my timeline.js.coffee to just timeline.js and putting the jQuery in there, but I get Uncaught SyntaxError: Unexpected token ILLEGAL.

                What should I do besides the obvious answer of "learn coffeescript"?

                解决方案

                I was on the right track. To switch to javascript in rails 3.2 you only need to remove the .coffee extension. However, you also need to make sure you use // for comments instead of #

                //# Place all the behaviors and hooks related to the matching controller here.
                //# All this logic will automatically be available in application.js.
                //# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
                

                这篇关于在没有咖啡脚本的 Rails 3.2 中使用 javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:使用jQuery将标题(&lt;h1&gt;--&lt;h6&gt;标签)解析为有序列表 下一篇:Javascript/Coffeescript 中关于 this/@ 的谜题

                相关文章

                <legend id='m4YGQ'><style id='m4YGQ'><dir id='m4YGQ'><q id='m4YGQ'></q></dir></style></legend>
                <tfoot id='m4YGQ'></tfoot>
                • <bdo id='m4YGQ'></bdo><ul id='m4YGQ'></ul>
              • <i id='m4YGQ'><tr id='m4YGQ'><dt id='m4YGQ'><q id='m4YGQ'><span id='m4YGQ'><b id='m4YGQ'><form id='m4YGQ'><ins id='m4YGQ'></ins><ul id='m4YGQ'></ul><sub id='m4YGQ'></sub></form><legend id='m4YGQ'></legend><bdo id='m4YGQ'><pre id='m4YGQ'><center id='m4YGQ'></center></pre></bdo></b><th id='m4YGQ'></th></span></q></dt></tr></i><div id='m4YGQ'><tfoot id='m4YGQ'></tfoot><dl id='m4YGQ'><fieldset id='m4YGQ'></fieldset></dl></div>

                  <small id='m4YGQ'></small><noframes id='m4YGQ'>