I'm using DocumentFragment to append some child nodes into list, but I'm facing nonsupporting problems in some browsers. So I wanted to know is there another way of checking that besides the method of checking if browser is in the list of supported browsers (or at least a method that do this job for me)?
Sorry!!! Here is the code that I'm using
var frag = document.createDocumentFragment();
var li = document.createElement('li');
li.className = "folders items";
li.innerHTML = '<a href="'+ f.id +'" title="'+ f.name +'" class="folders">'+icon+'<span class="name">' + name + '</span><span class="details">' + itemsLength + '<span class="desc '+nrMg+'">' + itemsDesc + '</span></span></a>';
frag.append(li);
container.append(frag);
container is Jquery object ($('#listF'))
Solved: My mistake, I was using append() which seems to work in chrome, but not in other browsers. The right method to append element on documentFragment is appendChild().
Working code:
var frag = document.createDocumentFragment();
var li = document.createElement('li');
li.className = "folders items";
li.innerHTML = '<a href="'+ f.id +'" title="'+ f.name +'" class="folders">'+icon+'<span class="name">' + name + '</span><span class="details">' + itemsLength + '<span class="desc '+nrMg+'">' + itemsDesc + '</span></span></a>';
frag.appendChild(li);
container.append(frag);