繁体   English   中英

bootstrap.js文件-这些是服务器端包含项的唯一类型吗? 这些文件应如何实施?

[英]The bootstrap.js file - are these a unique type of server-side include? How should these files be implemented?

在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

这些对应于下面的文件夹,该文件夹具有由每个“要求”行命名的js文件。

这些是javascript的特殊服务器端包含系统吗?

当我们讨论这个主题时,将这些文件包含在页面中的最佳实践是什么? 根据需要一对一地发送(更多请求?),或者根据需要将它们简单地粘贴到主文件中(确实需要做更多的工作,并且可能会发生变化,需要跟踪的东西更多)。

也许这里有些我想念的东西。

这些JS文件旨在由Sprockets加载/编译。

如果您不使用Rails,请查看sinatra的解决方案: https ://gist.github.com/datenimperator/3668587

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM