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

Leave a review

exclamation-circle Modules broken

More
10 years 11 months ago #2226 by rvennix
Modules broken was created by rvennix
Hello Olivier,

I installed the jQuery Easy plugin to fix some conflicts with mootools on my site, but one I can't fix. I think it has something to do with the header. The jdoc:include head seems to load some css and script, instead of including them. The jQuery Easy report says it has modified the header libraries, but I can't find where these modifications are stored. I would like to fix this issue. Any suggestions? You check the page source at matbase

Thanks in advance.

Regards,

Richard

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

More
10 years 11 months ago #2230 by admin
Replied by admin on topic Re: Modules broken
Hello,
the plugin jQuery Easy re-orders the libraries in the header to make sure it loads MooTools, jQuery and jquery no conflict code first. It does not do any other modification. The plugin is not responsible for any of the code that is loaded by the modules.
The line:
$j(document).ready(function(){
cannot work on your site for instance, because the '$' is used by MooTools and here one of your modules loaded this line for jQuery (colorbox). So you have conflict.
It should be something like
jQuery(document).ready(function($){

Also, some script that was supposed to be added through the jQuery Easy plugin was not (ADD_SCRIPT_DECLARATION_HERE is present and has not been replaced by your code for some reason)

You also have duplicated script code, but that may just be that you have several instances of the same module.

At this point, there are too many problems, you need to treat them one at a time. Start with colorbox.

Olivier.

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

More
10 years 11 months ago #2231 by admin
Replied by admin on topic Re: Modules broken
Sorry, I did not see: the code $j = new Object();... in the 'add script declaration' of the plugin is probably your main problem...

Olivier.

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

More
10 years 11 months ago #2232 by rvennix
Replied by rvennix on topic Re: Modules broken
Hi Olivier,

Thanks for your reply. $j = new Object() was a wild guess. I've removed that code already. I followed your article 'Solving jQuery issues with jQuery Easy: a case study' and tried to add var dinamods = jQuery.noConflict(); and var $j = jQuery.noConflict(); to the Add script declarations field, but indeed, somehow they are stripped right away. Do you have any idea what could cause this?

There are indeed two instances of the dinamods module on my frontpage. That should not be an issue, I had them working together, but not with all modules at once. I'm not sure what to do next. Maybe I could try to copy both scripts and customize them. Strip the original scripts in the jQuery Easy plugin and add the customized ones.

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

More
10 years 11 months ago #2233 by admin
Replied by admin on topic Re: Modules broken
You cannot use
var $j = jQuery.noConflict();
You just cannot use '$' for jQuery. Once again, it conflicts with MooTools.
You do not need this line, just replace
$j(document).ready(function(){...}
with
jQuery(document).ready(function($){...}
and all jQuery calls inside { ... } can start with $.

Also, you do not need var dinamods = jQuery.noConflict();
Dinamod is not written using jQuery.

Olivier.

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