如何解决jquery UI和Jquery mobile之间的冲突 [英] how to resolve the conflict between jquery UI and Jquery mobile

查看:124
本文介绍了如何解决jquery UI和Jquery mobile之间的冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery mobile和jquery UI。我添加了它们:

I am using jquery mobile with jquery UI . I have added them like :

 <script type="text/javascript" src="js/jquery-ui.min.js"></script>
 <script type="text/javascript" src="js/jquery.mobile-1.4.2.js"></script> 

正如我在Jquery mobile之前添加Jquery UI的文档中所建议的那样。但我得到了这两个图书馆之间的冲突。 我仅使用Jquery UI对列表进行排序。所以在此之前我还尝试添加jQuery.noConfict(),就像这个
//函数一样,使用jquery UI

as suggested in documentation I have added Jquery UI before Jquery mobile . but I am getting the conflict between this two libraries . I am using Jquery UI only for sorting the list . So before that I have also tried to add jQuery.noConfict() like this //function which using jquery UI

function sort()
{
  jQuery.noConfict();
  // after this I am using jQuery instead of $
}
//function that not using jquery UI
function delete()
{
//here I want to use $ again 
}

但这种方法对我不起作用。请提出一些解决方案。

but this approach not worked for me . please suggest some solution .

推荐答案

我应该解决冲突,如下所示

I thing you should resolve conflict like following

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
    var jQuery_1_9_1 = $.noConflict(true);
</script> <br />

现在使用 jQuery_1_9_1 作为 $ for jQuery version 1.9.1

Now use jQuery_1_9_1 as $ for jQuery version 1.9.1.

这篇关于如何解决jquery UI和Jquery mobile之间的冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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