JQuery / jQueryUI conflict

I use some jquery files to automatically complete and select a datetime control, but 3 of them conflict:

  • Two files for autocomplete:

    <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 selecting the date and time for the calendar:

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

These 3 files are compressed when I comment on the date when the autocomplete timing file works, and if I uncomment its autocompletion, it stops.

+6
source share
3 answers

If you want to include both 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> 

It is better to avoid multiple versions per page .. and it is better to use the appropriate version of jquery-UI with the jquery version

+9
source

If you try only this, I think you should 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.

+2
source

This is probably because you enable jQuery 2 times. Old version and newer version.

I would recommend you try and use the latest versions of jQuery and jQuery UI and check if everything works.

+1
source

All Articles