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

      use javascript in rails 3.2 without coffeescript(在没有咖啡脚本的 Rails 3.2 中使用 javascript)

      <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)
                CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                Ordinals in words javascript(javascript中的序数)
                getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
                <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'>

                            <tbody id='m4YGQ'></tbody>