Social Share plugin - js error TypeError: els[i].style is undefined

27.03.2016 18:20
#1
pitu
Joomshopping forum user no avatar
Name: Peter
19.08.2014
Posts: 7
Quote
Social Share plugin - js error TypeError: els[i].style is undefined

I have installed newest plg_jsocial_share_4.1.0.zip and Firefox 45.0.1 browser.

First - "VK ShareB" button works (if button is visible).
But, if you move the mouse over the "VK ShareB" button or you move the mouse out of the button, you can see these problems with javascript on Firefox developer toolbar console:
"TypeError: els.style is undefined"

It seems, it is javascript conflict between "https://vk.com/js/api/share.js?91" and "mootools-core.js" scripts - without "mootools-core.js" no problem occurs.
The best solution is not to load "mootools-core.js" script on page, if the "mootools-core.js" is not required for any Joomla! extension.


Just so interesting – on debugging share.js script together loaded with mootools-core.js on page (may be this help some developer):

variable "els" is array with 2 items, but cycle "for" takes up a third time and this results in an error – see next code fragment:
...
var els = [el.rows[0].cells[0].firstChild, el.rows[0].cells[1].firstChild];
for (var i in els) {
els.style.backgroundColor = color;
els.style.color = '#FFFFFF';
if (state == 2) {
els.style.paddingTop = '4px';
els.style.paddingBottom = '2px';
} else {
els.style.paddingTop = '3px';
els.style.paddingBottom = '3px';
}
}
...


Joomla: 3.5.0
JoomShopping: 4.12.3
PHP: 5.5.21
MySQL: 5.5.45-MariaDB
 
Copyrights MAXXmarketing GmbH. All Rights Reserved