Hello
I started to use JComments and I got the next error on IE 7 & 8 after the page load: "Unknown runtime error" (jcomments-v2.1.js line 306).
When I debug it, I saw that updateList function use the innerHTML property that
IE doesn't like. I try to use mootools (Joomla native JS library) to fix this problem, but JComments js libraries load before the mootools (Why?). In case we can use mootools, it's
much easier to do that.
After some research I rebuild the function as follow:
updateList: function(t,m){
if(this.list_id){
var l=this.$(this.list_id);
if(!l){
l=this.$('comments');
m='a';
}
switch(m){
case 'a':
//l.innerHTML=l.innerHTML+t; // IE buggy
var newdiv = document.createElement("div");
newdiv.innerHTML = t;
var container = document.getElementById(l.id);
container.appendChild(newdiv);
break;
case 'p':
//l.innerHTML=t+l.innerHTML; // IE buggy
var newdiv = document.createElement("div");
newdiv.innerHTML = t;
var container = document.getElementById(l.id);
container.insertBefore(newdiv, container.childNodes[0]);
break;
case 'r':
l.parentNode.innerHTML=t;
break;
}
}
},
It works, but it need review of the component original developers.
Regards