Tuesday, 15 April 2014

Mootools (joomla) + jQuery + Firefox conflict: selector bug -



Mootools (joomla) + jQuery + Firefox conflict: selector bug -

this specific - , bizarre - bug relating these specific software versions:

joomla 1.5.23 jquery 1.7.2 mootools upgrade (a joomla plugin) mootools 1.2.5 firefox 18.0.1

note bug might more widespread suggests; these versions i'm running.

in combination,

jquery('.st');

matches 3 of next elements:

<p class="test">one</p> <p class="st">one</p> <p class="stellar">one</p>

i've isolated cause next mootools script:

native.implement([element, document], { getelementsbyclassname: function(classname){ mootools.upgradelog('1.1 > 1.2: element.filterbytag deprecated.'); homecoming this.getelements('.' + classname); }, getelementsbyselector: function(selector){ mootools.upgradelog('1.1 > 1.2: element.getelementsbyselector deprecated. utilize getelements()'); homecoming this.getelements(selector); } });

specifically, it's homecoming statement in getelementsbyclassname alters native behaviour. i'm not sure why there's problem in firefox , not, example, chrome.

i'm wary of commenting out code because don't know lot 'mootools upgrade' plugin, , side-effects have. familiar plenty enough of above able shed light?

update

ok, after debugging, i'm getting closer. bug relates selectors.filters.byclass function depends on behaviour of string.contains(). of course, mootools overrides function - but override seems take effect in chrome. affects element.hasclass function makes similar phone call string.contains().

solution: upgrade joomla 1.5.26 latest security

upgrade jquery minimum 1.8.3. 1.9 (with migrate plugin if needed) if possible. problem solved?

jquery firefox joomla mootools

No comments:

Post a Comment