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

    <tfoot id='f5pGx'></tfoot>

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

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

      如何在开发网站时使用coffeescript?

      How to use coffeescript in developing web-sites?(如何在开发网站时使用coffeescript?)

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

            <tfoot id='Gm6G6'></tfoot>
                <tbody id='Gm6G6'></tbody>

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

              • 本文介绍了如何在开发网站时使用coffeescript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                您如何使用 CoffeeScript?它需要编译,所以 - 你用 CoffeScript 编写代码,编译它,然后在你的网站上插入真正的 JavaScript?

                How do you use CoffeeScript? It need to be compiled, so - you write code in CoffeScript, compile it, and insert real JavaScript on your site?

                不会花很多时间吗?还是有别的办法?

                Doesn't it take a lot of time? Or is there some another way?

                附:我已经看到了另一种方法 - 在开发阶段使用 coffeescript.js 库(大约 150k)在 text/coffeescript 脚本标签中插入咖啡脚本,并且只为生产版本编译并插入真正的 Javascript.

                P.S. I've seen another way - to insert in development stage coffeescript in text/coffeescript script-tags with coffeescript.js library (about 150k), and compile only for production version and insert real Javascript.

                推荐答案

                答案是肯定的,你自己编译并包含生成的 JavaScript.

                The answer is yes, you compile it and include the generated JavaScript on your side.

                如果您使用的是 web 框架(rails、django 等),您应该查看以下咖啡脚本插件列表:https://github.com/jashkenas/coffee-script/wiki/Web-framework-plugins.当您将应用程序部署到服务器时,他们会将您的咖啡脚本编译为 javascript.

                If you're using a web framework (rails, django etc) you should take a look at the following list of coffeescript plugins: https://github.com/jashkenas/coffee-script/wiki/Web-framework-plugins. They will compile your coffeescript to javascript when you deploy your app to a server.

                使用带有 text/coffeescript 标签的 coffee-script 插件是另一种选择,gzip 压缩和压缩,它只有大约 39kB,但如果你将它包含在获得很多点击的页面上,它可以加起来我不认为你可以在不需要插件的情况下自己将咖啡脚本编译为 javascript 是一个好主意.

                Using the coffee-script plugin with the text/coffeescript tags is another option, gzipped and compressed, its only about 39kB, but that can add up if you include it on pages that get many hits and I don't think is a good idea when you can compile the coffeescript to javascript yourself without needing the plugin.

                有 middleman 插件可以让您在开发过程中使用 CoffeeScript,然后编译和缩小用于部署.

                There is the middleman plugin which will lets you work with CoffeeScript during development, then compile and minify it for deployment.

                这篇关于如何在开发网站时使用coffeescript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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 在一年的第一天返回前一年)

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

                            <tbody id='sA0Ja'></tbody>