How to resolve "Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.appendChild]" erro
- by Holicreature
i have a json object returned from ajax and when i alert it, it is displayed correctly and i try to add those into a unordered list and add that to a place holder div, but throws the above error..
function handleResponse() {
if(httpa.readyState == 4){
var response = httpa.responseText;
//alert(response);
if(response!='empty')
{
//alert(response);
eval("prod="+response);
var len = prod.length;
var st = "<ul>";
for(var cnt=0;cnt<len;cnt++)
{
st = st + "<li onclick='set("+prod[cnt].id+")'>"+prod[cnt].name+"</li>";
}
st = st + "</ul>";
}
var tt = document.getElementById('holder1');
tt.appendChild(st); // i even tried **tt.appendChild(eval(st));**
tt.style.display = 'block';
}
}