在同一页面上使用两个jQuery版本 [英] Using two jQuery versions on the same page

查看:78
本文介绍了在同一页面上使用两个jQuery版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Twitter引导程序制作我的项目.我在jQuery中使用文件上传脚本扩展名.该插件已经开发.我只是要放置它.

I am making my project in twitter bootstrap. I am using a file upload script extension with jQuery. This plugin is already developed. I just ave to place it.

但是bootstrap是为其他jquery版本开发的,而此插件是使用jQuery 1.5.1版本开发的.

But bootstrap is developed for some other jquery version and this plugin is developed with 1.5.1 version of jQuery.

我计划不导入1.5.1版本.会造成问题吗?

I am planning to not to import the 1.5.1 version. Will it create an problem?

推荐答案

如果要同时包含这两个js文件,则可以使用noConflict使用多个版本的jquery js文件.

If you want to include both the js files..you can use jquery js files of multiple versions by using noConflict ..there is no problem with this

 <!-- load jQuery1.5 -->
    <script type="text/javascript" src="jquery/jquery-1.5.js"></script>
    <script type="text/javascript">
    var jQuery_1_5 = $.noConflict(true);
    </script>

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

这篇关于在同一页面上使用两个jQuery版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆