How do I get my custom jQuery modules to work after upgrading to Kentico 8.1?

326 Views Asked by At

After upgrading to Kentico 8.1, my site's jQuery modules seemingly disappeared. Kentico is unilaterally injecting its own jQuery module, overwriting my own reference. How do I prevent this?

2

There are 2 best solutions below

0
On

Kentico's own site documents the problem here. The solution is to customize Kentico's built-in jquery-core.js file, replacing the line var $cmsj = jQuery.noConflict(); with the line var $cmsj = jQuery.noConflict(true);. And pray that subsequent hotfixes/upgrades don't revert this change.

1
On

This topic is covered in the following article: Using a custom jQuery when developing pages in Kentico.

Kentico currently creates a jQuery alias. What you need to do is open the jquery-core.js file and locate the line stating:

var $cmsj = jQuery.noConflict();

Comment this line and then uncomment the line:

var $cmsj = jQuery.noConflict(true);