5.4 jQuery breaking changes / RadControl Version
Good day to Teleriks SF Team
Can someone help me understand this.
--------------
Breaking Changes
JavaScript libraries (JQuery, JQuery Cookie, JQuery Validate and etc.) are not always loaded on front-end. So, if you explicitly use some of these libraries, you need to take care to add them on the page.
-------------
I upgraded a site from 5.3 to 5.4 where I manually loaded the 1.8.3 jQuery in the head of my .master page.
<
script
type
=
"text/javascript"
src
=
"/MyResources/scripts/jquery-1.8.3.min.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/MyResources/scripts/jquery.cookie.js"
></
script
>
Well after upgrading to 5.4 some stuff stopped working. Well I thought since SF now uses 1.8.3 it might be a double loading issue so I did not load the script myself.
Not working
Then I moved the jquery.cookie.js loading from <head> just before </form> and it started working again. It seems that now the jquery.cookie.js is loaded after the 1.8.3 from Sitefinity
What I need to know
1) when will Sitefinity load 1.8.3
2) If it does not always (as mentioned in the breaking changes) what happens if I need jquery and add it to my .master. Would/Could this lead to double loading
3) Are RadControls still loading 1.7.2 in addition to the 1.8.3 that from SF
4) Any recommendations how to work best now
Markus
Radcontrols will never conflict with whatever other version SF is using...it's prefixed with $telerik
The only thing annoying with it is that you're being downloaded 60k instead of just 30k
If anything the conflict is you adding the jquery script yourself and it still being loaded with controls using the ResourceLink perhaps?
Thanks Steve
I don't mind loading the jquery scripts myself (even prefer it). I am just wondering in what cases SF will load the jquery which might result in double loading and confilcts.
Markus
@Telerik
Anyone with some light on this for me :-)
Markus
Hello Markus,
It is true that with 5.4 Sitefinity will load jQuery only when needed by an out of the box implementation. If you need certain JavaScript library on your page we recommend loading it using our ResourceLinks control instead on <script> tags.
The main advantage of the above approach is that ResourceLinks loads the libraries through ScriptManager, and can ensure that your library is not loaded multiple times on a page, if it's already been loaded.
Regarding the JavaScript libraries loaded by RadControls, these will always be loaded when RadControls are present on the page, however if you want to you can disable their embedded jQuery , and ensure the desired scripts are loaded yourself. The only drawback in this case is that you have to be careful to load the same version which the used RadControls version officially supports, to avoid unexpected behavior.
Regards,
Boyan Barnev
the Telerik team