function updateHTMLDirList(returnData) { var dirPath = returnData.getElementsByTagName('PATH_HEAD')[0]; var dirs = returnData.getElementsByTagName('DIR'); var videos = returnData.getElementsByTagName('VID_FILE'); var images = returnData.getElementsByTagName('IMG_FILE'); var files = returnData.getElementsByTagName('FILE'); var insertArea = document.getElementById('dynDiv'); var workingDir = dirPath.innerHTML; var i = 0; // Insert dirs document.getElementById("path").innerHTML = dirPath.innerHTML; insertArea.innerHTML = ""; if (workingDir === "./") { var i = 2 } // Remove ,. and ../ if in "root" var size = dirs.length; for (; i < size; i++) { var dir = dirs[i].innerHTML; if (dir != "resources/") { insertArea.innerHTML += "