Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Upgrading jQuery View modes: 
User avatar
Member
Member
scott_hancock-urmc.rochester - 3/19/2012 2:42:23 PM
   
Upgrading jQuery
Hi,

I'd like to upgrade the version of jQuery in Kentico.

If I register jQuery using the CMS.GlobalHelper.ScriptHelper.RegisterJQuery(this.Page), the system registers the library found here /cmsscripts/jquery/jquery-core.js. I could just replace that file with the new version, but as I understand it, Kentico has modified that file to use the noConflict() function. Is this correct?

So can I just replace the file and then call noConflict() and use jQuery() instead of $() in my scripts or will this cause problems?

What would you recommend for sites who want or need to use a newer version of jQuery?

Thanks,
Scott

User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/19/2012 8:37:41 PM
   
RE:Upgrading jQuery
Hello.

You are correct about this. What we did and what is main difference is that we modified it to use noConflict() function. You can see it in <project folder>\CMSScripts\jquery\jquery-core.js file.

If you reflect this change in your newer jQuery library, it should work.

Best Regards,
Radek Macalik

User avatar
Member
Member
scott_hancock-urmc.rochester - 3/20/2012 8:56:51 AM
   
RE:Upgrading jQuery
I was wondering why you want the library to use noconflict. I understand why I need to use it in my scripts but I don't see why the jQuery needs it also.

User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/20/2012 1:25:53 PM
   
RE:Upgrading jQuery
Hello.

The reason is that we are using other JS Frameworks, too, like Mootools and Prototype, so we need to use NoConflict() in order to get it work with these frameworks, too. If the jQuery was only JS Framework used in KCMS, it should not be needed.

Best Regards,
Radek Macalik

User avatar
Member
Member
scott_hancock-urmc.rochester - 3/20/2012 3:20:52 PM
   
RE:Upgrading jQuery
So the code added to the library, means that I don't need to use the NoConflict() function in my scripts.

User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/20/2012 4:20:37 PM
   
RE:Upgrading jQuery
Hello.

I am not sure where exactly you want to use your scripts, but it is possible it will be somewhere where other frameworks are loaded as well. Then you should need to use NoConflict(). I would recommend you to try it on some particular example and see how it behaves. Thank you.

Best Regards,
Radek Macalik

User avatar
Member
Member
scott_hancock-urmc.rochester - 3/21/2012 7:55:06 AM
   
RE:Upgrading jQuery
So what exactly do the Kentico changes to the jQuery library do?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/26/2012 5:25:36 PM
   
RE:Upgrading jQuery
Hello.

All script files are available in CMSScripts/jQuery folder, so you can have a look and compare it with default files. I am not aware of any other significant change other than what I already wrote.

If you are looking for more info about jQuery.NoConflict() mode, I would recommend you some public articles like this one.
We use it for reasons I described, but it is framework-related functionality for make it work with other libraries (like I explained).

For more details please refer to public articles as there is no other Kentico-related magic behind this than what I already wrote. Thank you.

Best Regards,
Radek Macalik

User avatar
Member
Member
lwhittemore-emh - 10/26/2012 12:51:33 PM
   
RE:Upgrading jQuery
I've tried to update the version of jQuery used on the site but it completely kills the cmsdesk and sitemanager.

How can I run my own version of Jquery in no conflict and not have it interfere with the cmsdesk and sitemanager?

User avatar
Member
Member
kentico_davidb2 - 11/2/2012 8:01:30 AM
   
RE:Upgrading jQuery
Hello,

in order to use your jQuery side by side with the one that kentico CMS uses, please
call:
var my_jQuery = jQuery.noConflict(true);

then you can use your version of jQuery by using my_jQuery without interfering with any other libraries.

Dave