Use Kendo UI at the same time as another jQuery version

The current version of jQuery Kendo's interface (Q3 2012) is 1.8.2.

I want to use this library on an existing site. The site already uses jQuery, but with version 1.5.0 1.4.4. Upgrading this version to version 1.8.2 is not an option, as it splits entire pages on some pages of some components.

Can both of them work simultaneously on the same site / page?

Telerik.ASP.NET.Ajax used a proxy for jQuery, which ensured that their controls always used the right jQuery library:

$telerik = $; 

Does KendoUI have something similar?

+4
source share
1 answer

You should just do this:

 <script src="jquery-1.5.0.min.js"></script> <!-- plugins for 1.5.0 first... --> <script src="jqueryui.min.js"></script> <script src="jquery.hoverintent.min.js"></script> <!-- then your code --> <script src="main.js"></script> 

where main.js contains:

 var $jqueryold = $.noConflict(true); (function($){ // do stuff with $ $(document).ready(function(){ // ... }); })($jqueryold); 

You can also skip the immediately executable function if all your code is inside the document:

 var $jqueryold = $.noConflict(true); $jqueryold(document).ready(function($){ // do stuff with $ $("#tabs").tabs(); }); 

However, an ideal solution would be to upgrade the old code to work with the new version of jQuery.

+5
source

All Articles