JQuery plugin that works with Google 1.10.2 and not with WordPress 1.10.2

I’m making a custom implementation of JQuery Colorbox in a WordPress plugin. However, it’s not working with my default WordPress installation. After tinkering a bit, it comes down to the inclusion of the JQuery library.

Neither of these lines work:

<script src='http://xpisobsolete.com/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

But either one of these do:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

I’ve tested that JQuery works with all of the above by using:

if (typeof jQuery != 'undefined') {

    alert("jQuery library is loaded!");


    alert("jQuery library is not found!");


It passes on all four of the script links I’ve tried. If I change that one line on Jack’s demo page, it breaks as well. Is this a colorbox issue?

Could you guys help me see what I’m missing here? I’m stumped.

Solutions Collecting From Web of "JQuery plugin that works with Google 1.10.2 and not with WordPress 1.10.2"

Try placing your code in this

(function($) {
    // Inside of this function, $() will work as an alias for jQuery()
    // and other libraries also using $ will not be accessible under this shortcut

I’m suspecting your code uses $, which is normally an alias for jQuery but doesn’t work globally because WP’s version of jQuery is in no conflict mode. $ will work if the code is placed in an enclosure such as the one above.