Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Bug-reports    Topic: "Unknown runtime error" on IE
Pages: [1]   Go Down
  Print  
Author Topic: "Unknown runtime error" on IE  (Read 2985 times)
0 Members and 2 Guests are viewing this topic.
oc666
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« on: October 15, 2010, 16:14:22 »

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:
Code:
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
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: October 15, 2010, 20:58:37 »

I've tested with IE6, IE7 and IE8 and couldn't reproduce this issue. Your code must work without any problems. It do the same thing as mine but it quite bigger and it adds extra DIV element. But this doesn't matter and wouldn't cause any problems.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
oc666
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #2 on: October 16, 2010, 20:14:15 »

I've tested with IE6, IE7 and IE8 and couldn't reproduce this issue. Your code must work without any problems. It do the same thing as mine but it quite bigger and it adds extra DIV element. But this doesn't matter and wouldn't cause any problems.
Thanks for the reply.
First of all this topic need to move to JComments->bug report (and not  ProofReader component->bug report).

I'm using JA_PURITY template. Maybe this cause the problem?
Is the component required mootools pre-load?

Regards
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #3 on: October 20, 2010, 01:40:57 »

Is the component required mootools pre-load?
No, it doesn't use any 3rd party JavaScripts...
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
oc666
Newbie
*

Karma: 0
Offline Offline

Posts: 3


Email
« Reply #4 on: October 20, 2010, 15:37:15 »

Is the component required mootools pre-load?
No, it doesn't use any 3rd party JavaScripts...
OK. So why is the use of innerHTML, if IE doesn't like it (see here: http://domscripting.com/blog/display/99)?
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #5 on: October 21, 2010, 18:45:00 »

OK. So why is the use of innerHTML, if IE doesn't like it (see here: http://domscripting.com/blog/display/99)?
1. This way is quite shorter
2. This way works prefectly with other browsers
3. This way works for me with IE6-8 without any problems. You're first who reported me about this issue.
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Bug-reports    Topic: "Unknown runtime error" on IE
 
Jump to: