Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

file jQuery is not defined

More
9 years 8 months ago #4121 by kinwolf
jQuery is not defined was created by kinwolf
Hi,

I just installed jqueryeasy to try to solve jquery conflict, and while it works when I select to load jquery from Joomla Framework, it doesn't work when I try to load jquery from google CDN.

I then get the script error "Error in file:/plugins/system/jqueryeasy/jquerynoconflict.js; Error:jQuery is not defined"

The subversion is defined in jqueryeasy and here is the report(it's in french, but I'm sure you're so used to reading that report now that you don't require the first few words in english :P)

Bootstrap est chargé par le template
jQuery est chargé par le template
scripts ré-organisés dans <head>
retiré 1 script(s) jquery-noconflict.js
retiré bibliothèque jQuery /media/jui/js/jquery.min.js
retiré bibliothèque jQuery www.quebeciskf.com/components/com_compro...s?v=1744e53b3d1feef1
bibliothèque jQuery ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js ajoutée
retiré 2 script(s) Migrate
plugin jQuery Migrate /media/jui/js/jquery-migrate.min.js ajouté
script /plugins/system/jqueryeasy/jquerynoconflict.js ajouté
retiré 5 <script> vides
Temps d'excécution (en secondes): 0.30646467208862

So it seems to load jquery 1.11.2 from google correctly, but the website can't seem to be able to use it. When I select "Joomla Framework" as the source it works, and the report looks like this:
Bootstrap est chargé par le template
jQuery est chargé par le template
scripts ré-organisés dans <head>
retiré 1 script(s) jquery-noconflict.js
retiré bibliothèque jQuery /media/jui/js/jquery.min.js
retiré bibliothèque jQuery www.quebeciskf.com/components/com_compro...s?v=1744e53b3d1feef1
bibliothèque jQuery /media/jui/js/jquery.min.js ajoutée
retiré 2 script(s) Migrate
plugin jQuery Migrate /media/jui/js/jquery-migrate.min.js ajouté
script /media/jui/js/jquery-noconflict.js ajouté
retiré 5 <script> vides
Temps d'excécution (en secondes): 0.30301308631897

Any idea why it doesn't work with google jquery? It's the same version after all. I did take a look at other forum post, but no solutions from those either.

thanks

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #4122 by admin
Replied by admin on topic jQuery is not defined
Hello,

this is rather strange, I really can't tell why this does not work in this case.
Is it possible to get access to a live page with the Google library loaded in order to figure out what is going on?
In theory, there should be no reason for this to fail...
If you need to forward credentials, you can email me at [email protected].

Thank you!

Olivier.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #4133 by kinwolf
Replied by kinwolf on topic jQuery is not defined
Hi,

Doing some more debugging last night I figured out that the problem is btw JCH and jqueryeasy. (funny thing, it's the JCH developer that told me about your extension because he saw a jquery conflict while debugging a problem we had with jch and a form)

So, in the current config, the jqueryeasy plugin is positioned after JCH and before jotcache. If I select JoomlaFramework as the source of jquery, it works, but if I select google CDN, we get the error message mentionned above. I tried positioning the JCH plugin after jqueryeasy to see what it would do, but that broke everything. So I put it back like it was.

I'll send you an admin logon tomorrow if you want. Today is the registration day for an event we are planning, so javascript needs to be operational all day. :)

Thanks!

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #4136 by admin
Replied by admin on topic jQuery is not defined
Interesting...
Well, according to all what you are telling me, you are better off just using the jQuery packaged with the framework (which is a reasonable solution anyway).
You did not mention you used JCH optimize in your previous post.
Optimizations made with JCH Optimize and jQuery Easy are incompatible most of the time. jQuery Easy, for instance, can only work on files it finds in the page and if scripts are bundled and minimized by JCH, it won't be able to find the scripts to remove and replace...
Something to remember: both plugins need to be last to work on a page for them to properly do the work that is asked of them. Therefore you get conflicts...

Olivier.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #4141 by kinwolf
Replied by kinwolf on topic jQuery is not defined
A quick follow up

The problem is finally fixed. It was a small bug in JCH where JCH wasn't able to load jquery when it pointed to a CDN. The dev fixed it in version 4.2.2.2 and now both JCH and jQuery are working nicely together.

Thanks.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #4142 by admin
Replied by admin on topic jQuery is not defined
Thank you very much for the follow up, I appreciate it.
Glad it works now :-)

Olivier.

Please Log in or Create an account to join the conversation.