Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The real problem is that the plugins you want require different versions of jQuery: You say the popup and slider work with 1.9.1, but colorbox requires 1.3, meaning that so far you can't get a situation whereby all 3 work. The real question, then, is "how can I use different versions of jQuery on the same page?".</p> <p><a href="https://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page">This has been answered before</a>: Use jQuery's <code>noConflict</code> function to get both versions of jQuery represented by different variables, then invoke the plugins as necessary.</p> <p>Seeing as colorbox is the odd one out (and using an ancient version of jQuery for most of your code will be increasingly difficult), it's probably best to use jQuery 1.9.1 (or higher) by default, then set jQuery 1.3 to a different variable. I've paraphrased filenames, paths, etc, but the code below should give you an idea:</p> <pre><code>&lt;script src="jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;script src="popup.js"&gt;&lt;/script&gt; &lt;script src="slider.js"&gt;&lt;/script&gt; &lt;script src="jquery-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script src="colorbox.js"&gt;&lt;/script&gt; &lt;script&gt; $old = $.noConflict( true ); &lt;/script&gt; </code></pre> <p>Now a runthrough of what's happening above:</p> <ol> <li>Load jQuery 1.9.1, which assigns itself to the <code>$</code> and <code>jQuery</code> variables.</li> <li>Load the popup and slider scripts. These assume that jQuery 1.9.1 is bound to the variable names above (which it is), and attach their behaviour.</li> <li>Load jQuery 1.3.2, which replaces the jQuery variables with itself - jQuery 1.9.1 can no longer be referenced in the global scope — but that's not a problem for the popup and slider plugins, because they've already executed and attached their behaviour.</li> <li>Load the colorbox script, which finds jQuery 1.3.2 and binds to it.</li> <li>Call jQuery 1.3.2's <code>noConflict</code> - this assigns current <code>$</code> and <code>jQuery</code> variables back to whatever they were before this version of jQuery executed (jQuery 1.9.1), and assigns the current jQuery (1.3.2) to whatever variable you provide. From this point onwards, you'll need to use that varialbe instead of <code>$</code> if you want to use jQuery 1.3.2 or the colorbox plugin.</li> </ol> <p><a href="http://jsfiddle.net/barney/HT23S/" rel="nofollow noreferrer">I created a proof of concept here</a>: these plugins are extremely simple (all they do is use jQuery to make clicking paragraphs alert messages), but they will only function if they have the correct version of jQuery.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload