Topic: Question about jQuery

On the Tour page I read:

jQuery Compatible
Juicebox is built with jQuery and is compatible with all versions of jQuery and other JavaScript frameworks.

I don't get that I tried building a test gallery with JuiceboxBuilder-Lite.app
In the HTML jQuery is not loaded, nor in the examples on your demo pages.

Looking at the jbcore/juicebox.js script at a whomping 200kb I could only assume jQuery is somewhat compiled into the obsfuscated file? Am I correct?
But on a page where I already have a copy of jQuery loaded it's a waist of filesize...
Do you provide a juicebox.js without jQuery compiled?

Re: Question about jQuery

I could only assume jQuery is somewhat compiled into the obsfuscated file? Am I correct?

Yes. That is correct. Juicebox comes with its own version of jQuery bundled within the 'juicebox.js' file.
In doing so, we know that Juicebox will work.
Otherwise, we would have to rely on users including jQuery in their web pages (a further step in the embedding process) and we could not guarantee that the version of jQuery that the user uses does not have any bugs in it which would result in the Juicebox gallery failing to function correctly.

But on a page where I already have a copy of jQuery loaded it's a waist of filesize...

You might think that it would be OK to just use the the version of jQuery which comes bundled within the 'juicebox.js' file to save you from loading a separate version of jQuery in your web page.
However, if Juicebox ever changes its version of jQuery or strips out any jQuery functionality or changes its built-in JavaScript library completely, then your web page may break. Therefore, if your web page requires jQuery for anything other than Juicebox, I would recommend that you continue to load jQuery separately in your page.

Do you provide a juicebox.js without jQuery compiled?

No. There is no version of the 'juicebox.js' file available without jQuery included.

3 (edited by antonputtemans 2014-03-30 15:42:53)

Re: Question about jQuery

OK I understand, thanks for the explanation Steven
Just out of interest, I did a quick

jQuery.fn.jquery;

and that resulted in v1.7

Let's try the other way around than :-)
So I assume I can use all functionality from the compiled 1.7 version in the page?
Or is it a stripped down version maybe?

EDIT: OK I just read your reply with more attention, nevermind