Support » Plugin: Use Google Libraries » jQuery entries in the source code

  • Resolved GermanKiwi


    Hi Jason,

    I’ve just installed your plugin for the first time, in order to replace the WordPress jquery and jquery-ui links with the Google equivalents – seems to be working great so far!

    I have a couple of questions for you:

    1) In addition to changing the link URLs in the <head> section, the plugin also added this line:

    <script type='text/javascript'>try{jQuery.noConflict();}catch(e){};</script>

    Can you explain what this is for or what it does?

    2) Before installing your plugin, my site had the following line at the very end of the source code, just before the closing </body> tag – along with a few other lines for CSS and JS files from my theme and from some other plugins:

    <script type='text/javascript' src=''></script>

    But your plugin has moved this line to the top, into the <head> section:

    <script type='text/javascript' src='//'></script>

    I’m wondering why this is? I imagine there must be a good reason why the jquery-ui file is originally at the very end and not in the head section. Wouldn’t it be better if your plugin leaves it in the same location as it originally is?


Viewing 1 replies (of 1 total)
  • Plugin Author Jason Penney


    The extra script tag are to keep thing compatable with WordPress core. The jquery.js provided by WordPress has been modified to end with jQuery.noConflict(), so this does it’s best to ensure you get the same result when pulling jQuery from google.

    My plugin is not changing where it’s loading (or it shouldn’t be), but the WordPress script loader is. Note that jQuery-UI when coming from Google is a single file, and from WordPress it’s a bunch of small files. Same content, but the browser performance is better when it’s one file. There’s a chance this difference is interacting with some prerequisite of some other script, causing the script loader to determine it should load in the header.

Viewing 1 replies (of 1 total)
  • The topic ‘jQuery entries in the source code’ is closed to new replies.