在 bootstrap sass 下载 ( https://github.com/twbs/bootstrap-sass/archive/v3.1.1.tar.gz ) 中有一个奇怪的 bootstrap.js 文件,其中所有这些行都被注释掉了,如下所示:
//= require bootstrap/affix
//= require bootstrap/alert
//= require bootstrap/button
//= require bootstrap/carousel
//= require bootstrap/collapse
//= require bootstrap/dropdown
//= require bootstrap/tab
//= require bootstrap/transition
//= require bootstrap/scrollspy
//= require bootstrap/modal
//= require bootstrap/tooltip
//= require bootstrap/popover
这些对应于下面的文件夹,其中包含由每个“require”行命名的 js 文件。
这些是某种特殊的服务器端包含 javascript 的系统吗?
当我们讨论这个主题时,将这些文件包含在页面中的最佳做法是什么?根据需要 1 对 1(更多请求?)或根据需要将它们简单地粘贴到主文件中(确实需要更多工作,并且可能会发生变化,需要跟踪更多内容)。
也许我在这里遗漏了什么。
最佳答案
这些 JS 文件旨在由 Sprockets 加载/编译.
如果您不使用 Rails,请查看 sinatra 的解决方案:https://gist.github.com/datenimperator/3668587
关于javascript - bootstrap.js 文件 - 这些是服务器端包含的独特类型吗?这些文件应该如何实现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24299791/