Below is a JS function:
I'd like to update this so it uses jQuery but I am having difficulty figuring out how to translate it.
function pathContents(fileList) {
var list = document.createElement('ul');
for (file in fileList) {
var item = document.createElement('li');
item.appendChild(document.createTextNode(fileList[file]));
list.appendChild(item);
}
return list;
}
UPDATE: Removing the call to pathContents() and replacing it with Malvolio's code - this is the browser output -
Why isn't it displaying the data as list items in an unordered list?