Page 1 of 1

jQuery purpose on frontend

Posted: Wed Mar 18, 2015 3:41 pm
by Don Chambers
I have a scenario where the version of jQuery packaged with 2.0 (1.11.2) is breaking something in a theme of mine that jQuery included in 1.7.8 (1.8.3) did not.
  • What does jQuery do on the front end?
  • Can we specifically tell s9y to NOT load jQuery, so a theme can load a specific version of jQuery, different from what s9y would use on the front end?
  • I know I can load an older version of jQuery since s9y is using no-conflict, and this actually solves my problem. Is there a huge down side to this?

Re: jQuery purpose on frontend

Posted: Wed Mar 18, 2015 7:10 pm
by yellowled
Don Chambers wrote:What does jQuery do on the front end?
Various plugins (lightbox comes to mind) and themes (2k11, for instance) use it in their JS. jQuery itself does not do anything since it's a library.
Don Chambers wrote:Can we specifically tell s9y to NOT load jQuery, so a theme can load a specific version of jQuery, different from what s9y would use on the front end?
Yes. Set $serendipity['capabilities']['jquery'] = false; in your config.inc.php, bundle your own jQuery version (but set noConflict mode for that as well for plugins to work properly).
Don Chambers wrote:I know I can load an older version of jQuery since s9y is using no-conflict, and this actually solves my problem. Is there a huge down side to this?
Yes. You would be loading 2 versions of the same library which means an extra http request, about 95KB loaded unneccessarily and a very bad practice. Also, you're gonna get laughed at. :wink:

The best solution would really be to fix whatever is not working with jQuery 1.11.2 any longer. This is most likely related to something in the theme's JS (or maybe a jQuery plugin used in the theme) that was deprecated in jQuery between 1.8.3 and 1.11.2. Does it give you any error message in the browser's JS console?

YL

Re: jQuery purpose on frontend

Posted: Wed Mar 18, 2015 7:29 pm
by Don Chambers
yellowled wrote:The best solution would really be to fix whatever is not working with jQuery 1.11.2 any longer. This is most likely related to something in the theme's JS (or maybe a jQuery plugin used in the theme) that was deprecated in jQuery between 1.8.3 and 1.11.2. Does it give you any error message in the browser's JS console?
Yeah, I know. It is not the theme's own JS, it is an included jQuery plugin that I have to update.... and really didn't want to update!! :|

Re: jQuery purpose on frontend

Posted: Wed Mar 18, 2015 9:17 pm
by Don Chambers
Have we ever used < jQuery 1.7 on the front end? 1.7.8 used jQuery 1.8.3.

Re: jQuery purpose on frontend

Posted: Wed Mar 18, 2015 9:28 pm
by yellowled
Yes. The first jQuery ever to be bundled with the s9y core was 1.4.4.

https://github.com/s9y/Serendipity/comm ... /jquery.js

YL