6

I am using some jquery files for auto complete and datetime picker control but 3 files among them are conflicting:

  1. 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>  
    
  2. One file for Calender datetime picker is:

    <script  src="../assets/js/jquery-1.8.3.min.js"></script> 
    

These 3 files are confilicting when i comment date time picker file autocomplete works and if I uncomment it autocomplete stops.

Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187
  • 2
    You should be including only **ONE** version of jQuery per page, and it should be the latest. Working with 1.4.2 and jQueryUI 1.8.1 is asking for trouble. – ahren Mar 13 '13 at 10:49
  • why using older version for autocomplete? – Jai Mar 13 '13 at 10:49

3 Answers3

9

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>

Its better to avoid multiple versions in the page..and its better to use appropriate jquery-UI Version with the jquery version

sasi
  • 4,192
  • 4
  • 28
  • 47
  • May be the order is the problem..add this ui file of 1.8.4 under jquery 1.8 file or put jquery 1.4.2 on top.. – sasi Mar 20 '13 at 12:29
2

If you try only these, i think you are good to go:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js">
</script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.js">
</script>

No need to add other versions of jquery.

Jai
  • 74,255
  • 12
  • 74
  • 103
1

That's probably because you are including jQuery 2 times. An old version and a newer version.

I would recommend you try and use the most recent versions of both jQuery and jQuery UI and check if everything still works.

JohnHeroHD
  • 194
  • 1
  • 2
  • 11