jQuery / jQueryUI冲突 [英] jQuery/jQueryUI conflict
本文介绍了jQuery / jQueryUI冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用一些jquery文件进行自动完成和日期时间选择器控制,但其中3个文件存在冲突:
I am using some jquery files for auto complete and datetime picker control but 3 files among them are conflicting:
-
两个自动填充的文件是
Two files for autocomplete are
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
日历时间选择器的一个文件是:
One file for Calender datetime picker is:
<script src="../assets/js/jquery-1.8.3.min.js"></script>
当我评论约会时,这3个文件都是混淆的时间选择器文件自动完成工作,如果我取消注释它自动完成停止。
These 3 files are confilicting when i comment date time picker file autocomplete works and if I uncomment it autocomplete stops.
推荐答案
如果你想同时包含两个js文件。 。
If you want to include both the js files you can..
<!-- load jQuery 1_8_3 -->
<script src="../assets/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
var jQuery_1_8_3 = $.noConflict(true);
</script>
<!-- load jQuery 1.4.2 -->
<script type="text/javascript" src="jquery/jquery-1.4.2.js"></script>
<script type="text/javascript">
var jQuery_1_4_2= $.noConflict(true);
</script>
最好避免页面中有多个版本......最好使用合适的jquery-UI版本使用jquery版本
Its better to avoid multiple versions in the page..and its better to use appropriate jquery-UI Version with the jquery version
这篇关于jQuery / jQueryUI冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文