开发和生产中的不同jQuery版本

时间:2016-06-17 02:56:10

标签: javascript jquery node.js twitter-bootstrap meteor

我正在使用Mantra规范制作Meteor应用程序。我遇到了jQuery版本的问题。这是场景:

我的.meteor文件夹中的软件包包括twbs:bootstrap和jquery。同时,我有依赖于jquery的npm包。

当我在本地环境中运行$.fn.jquery时,它会返回2.2.4。但是当它部署在临时站点上时,它会返回3.0.0

我怎么在这里弄错了?控制台抛出错误:" Bootstrap Javascript需要jQuery 1.9.1或更高版本,但小于3。"请帮我。提前致谢

1 个答案:

答案 0 :(得分:0)

您可以使用jQuery.noConflict() read the user guide here

来解决问题
<script src="other_lib.js"></script>
<script src="jquery.js"></script>
<script>
$.noConflict();
    jQuery( document ).ready(function( $ ) {
    // Code that uses jQuery's $ can follow here.
    }); 
    // Code that uses other library's $ can follow here.
 </script>
相关问题