Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: speck on October 05, 2012, 12:25:41

Title: IOSSLIDER... High Risk of JQuery conflict [SOLVED]
Post by: speck on October 05, 2012, 12:25:41
IOS SLider with other modules use Jquery not work.   ??? ??? ???
Maybe must me sanitize with jQuery.noConflict();
Title: There is no JQuery conflict
Post by: datahell on October 05, 2012, 13:28:43
Dont fear people by saying things like that except if you are absolutely sure and you can aprove it. I am absolutely sure that it is your fault... We haven't even published the documentation for developers. It is almost certain that you dont know how to properly load javascript in Elxis 4.x. If you read the Elxis Document library you will see that there is no way to load multiple js libraries instances that can leed to a version conflict.

All built-in or downloaded from EDC modules, plugins, etc, work fine, there is no conflict as they all use the same jquery library which is loaded only once. We are not responsible for other extensions or your own experiments.
Be more specific if you need further assistance.

To include jQuery in Elxis use this syntax:
eFactory::getDocument()->addJQuery();
If you use the above syntax there is no way to have a conflict in Elxis.
Note that you should use only jquery, not mootools or other js library.
Title: Re: IOSSLIDER... High Risk of JQuery conflict
Post by: speck on October 06, 2012, 09:54:45
Thanks,
did it :)

but it seems the extension goes in conflict also if use

jQuery.noConflict() in hi js file

Code: [Select]
var $jdslnp = jQuery.noConflict();
(function($) {
bla bla bla bla bla
........................
........................
})(jQuery)

Title: Re: IOSSLIDER... High Risk of JQuery conflict
Post by: datahell on October 06, 2012, 10:05:48
It is not a conflict, you have implemented the script wrong.
See the official demo and compare it with your own module:
http://landofcoder.com/demo/jquery/lofslidernews/index.html (http://landofcoder.com/demo/jquery/lofslidernews/index.html)
Title: jQuery.noConflict function
Post by: webgift on October 06, 2012, 10:56:21
You don't need to implement jQuery.noConflict() function speck. Run this function to give control of the $ variable back to whichever library first implemented it. This helps to make sure that jQuery doesn't conflict with the $ object of other libraries (we don't have any other library here). By using this function, you will only be able to access jQuery using the 'jQuery' variable. For example, where you used to do $("div p"), you now must do jQuery("div p").

NOTE: This function must be called after including the jQuery javascript file, but before including any other conflicting library, and also before actually that other conflicting library gets used, in case jQuery is included last. noConflict can be called at the end of the jQuery.js file to globally disable the $() jQuery alias. jQuery.noConflict returns a reference to jQuery, so it can be used to override the $() alias of the jQuery object.

More information about jQuery.noConflict() function: here (http://docs.jquery.com/Using_jQuery_with_Other_Libraries)
Title: Re: IOSSLIDER... High Risk of JQuery conflict
Post by: speck on October 07, 2012, 11:31:52
Hi web gift...

HURRRAAAAAA ....... SOLVED

tanks for all to u and Ioannis about some tips gave it to me by PM.
Step by step, with your help and get a look to some parts of new code, i'm finding new elxis very easy to create module.
Great work.
+ 10 and more
Title: Re: IOSSLIDER... High Risk of JQuery conflict [SOLVED]
Post by: webgift on October 07, 2012, 16:48:50
You are welcome, speck! Keep doing things for elxis with the same passion ;)
Title: Re: IOSSLIDER... High Risk of JQuery conflict
Post by: Amigamerlin on October 08, 2012, 13:17:14

http://test1.elxisitalia.com



Great module Speck... where I can download it?  ;D ;D