dsl36367 2016-04-16 10:30
浏览 183

如何将jquery-1.10.2.js和jQuery-2.1.4.min.js包含在一起

Hello I am including jQuery-2.1.4.min.js and jquery-1.10.2.js together but I am getting error:

custom.js:375 Uncaught TypeError: $(...).autocomplete is not a function

If i remove jQuery-2.1.4.min.js then i m getting error in one price ranger. So i can not remove any one JS.

So how to use both so that my price ranger and autocomplete functionality works ?

Script:

<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="mydirectorypath/js/jQuery-2.1.4.min.js"></script>

By Above code I am getting error $(...).autocomplete is not a function

  • 写回答

2条回答 默认 最新

  • duanmei4362 2016-04-16 11:37
    关注

    It is possible to use two jQuery in the same page. Like below

    <!-- load jQuery 2.1.4 -->
    <script type="text/javascript" src="mydirectorypath/js/jQuery-2.1.4.min.js"></script>
    <script type="text/javascript">
    var jQuery_2_1_4 = $.noConflict(true);
    </script>
    

    Now you can use jQuery_2_1_4 than the $

    <!-- load jQuery 1.10.2 -->
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script type="text/javascript">
    var jQuery_1_10_2 = $.noConflict(true);
    </script>
    

    Now you can use jQuery_1_10_2 than the $

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置