2012-04-16 117 views
2

当我包括enhance.js插件它与其他的jQuery插件,比如UI jQuery插件冲突文件

我无法使用日期选择器功能,例如冲突。

可能的解决方案是什么?

+0

有你有把显示的任何代码或控制台了呢?很难说出它可能是什么。 – GillesC 2012-04-16 06:17:57

回答

1

从技术文档:http://api.jquery.com/jQuery.noConflict/

<script type="text/javascript" src="other_lib.js"></script> 
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript"> 
    $.noConflict(); 
    // Code that uses other library's $ can follow here. 
</script> 

和/或你可以在这里使用别名:

<script type="text/javascript" src="other_lib.js"></script> 
<script type="text/javascript" src="jquery.js"></script> 
<script type="text/javascript"> 
    $.noConflict(); 
    jQuery(document).ready(function($) { 
    // Code that uses jQuery's $ can follow here. 
    }); 
    // Code that uses other library's $ can follow here. 
</script> 
+0

不确定这是问题,因为他试图使用的库不会覆盖$或jQuery。 – GillesC 2012-04-16 06:17:46