WordPress.org

Ready to get started?Download WordPress

Forums

Ajax Google Libraries CDN
WP uses jQ.ui library not loaded on CDN (12 posts)

  1. MarkLL
    Member
    Posted 2 years ago #

    WordPress 3.4 uses the jQuery UI library ver: 1.8.20. The latest stable release available from jQuery UI website is 1.8.21. (as at 2012-06-17).

    Unfortunately the latest version on Googles' CDN, at this point, is 1.8.18.

    One option is to modify the code by duplicating the hack for the scriptaculous version. (around line 238) as in:

    if ( 'jquery-ui-' == substr($name, 0, 10) && '1.8.20' == $ver ) {
       $ver = '1.8.18';
    }

    Cheers,
    Mark

    http://wordpress.org/extend/plugins/ajax-google-libraries-cdn/

  2. valuser
    Member
    Posted 2 years ago #

    One option is to modify the code by duplicating the hack for the scriptaculous version. (around line 238) as in:

    Which file please ?

  3. valuser
    Member
    Posted 2 years ago #

    got it

  4. MarkLL
    Member
    Posted 2 years ago #

    I'm glad you found it LOL...

    There is only one file.

  5. colinskys
    Member
    Posted 2 years ago #

    Hi guys, I didn't find it. Can you let me know which file I need to change the code in, thanks.

  6. MarkLL
    Member
    Posted 2 years ago #

    Hi colinskys,

    Please note my initial post applies to the "Ajax Google Libraries Cdn" plugin.

    If you look in the wp-content/plugins folder you should see a "ajax-google-libraries-cdn" folder. In this folder is a file called "use-google-libraries.php".

    This is the file I am talking about.

    On line 238 there is the following:

    if ( $name == 'scriptaculous-root' && $ver == '1.8.0' ) {
       $ver = '1.8';
    }

    so right under that you should paste the code I added in the initial post above.

    While I'm not actually using this plugin, I added similar functionality to a theme I was developing that had the same issue.

    Symptons were: jQuery Slider and Tabs stopped working.

    Hope that helps :)

  7. colinskys
    Member
    Posted 2 years ago #

    Hi MarkLL,

    Thank you kindly for your reply. I installed the "Ajax Google Libraries Cdn" plugin, activated it, added the code as you mentioned, cleared the cahce with "W3 Total Cache" but still slider, toggles and twitter widget are not working.

    My theme is revelation, and my website address is http://drcolinmacleod.com. Any further insight would be much appreciated.

  8. MarkLL
    Member
    Posted 2 years ago #

    Colinskys,

    The fix was only relevant IF you already was using the "Ajax Google Libraries Cdn".

    I don't use "W3 Total Cache", but I think it actually does the same thing so adding "Ajax Google Libraries Cdn" may not be the right thing.

    Looking at the source code for your site, I can see that the jQuery UI (v1.8.13) is being loaded Before jQuery (v1.7.2). This is not correct.

    Can I suggest you disable the "Ajax Google Libraries Cdn" plugin as well as the "W3 Total Cache" plugin and see if that fixes it.

    There are a lot of jQuery libraries being loaded by your revelation-theme and it may be unregistering WP's jQuery and registering it's own version. It could be that the jQueryUI is being registered without a dependancy set to jQuery. Without looking at the source it's a bit hard to tell.

    good luck.

  9. colinskys
    Member
    Posted 2 years ago #

    MarkLL,

    I didn't have any luck with disabling the plugins, the jquery is still not working. The creator of Revelation has vanished so it's a bit of a waiting game until someone finds a fix.

    Thanks,
    -Colin

  10. dspilka
    Member
    Posted 2 years ago #

    I just tried this plugin. Thanks for your fix, MarkLL.

    Any ideas when Google will get 1.8.20 and 1.8.21 on their CDN?

  11. colinskys
    Member
    Posted 2 years ago #

    It was fixed for me too. Somebody over at the my theme's forum found a fix: http://themeforest.net/item/revelation-elegant-and-clean-wordpress-theme/discussion/807437?page=30

    "replace the line
    wp_enqueue_script( 'jquery' );

    with the following:
    wp_deregister_script('jquery'); wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', array(), '1.7.2', false); wp_enqueue_script( 'jquery' );"

    Thanks,

  12. dspilka
    Member
    Posted 2 years ago #

    So the google cdn now has jquery-ui version 1.8.21. So I'm using that version for MarkLL's fix instead of 1.8.18, like:

    if ( 'jquery-ui-' == substr($name, 0, 10) && '1.8.20' == $ver ) {
       $ver = '1.8.21';
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic