let currDir = {'loc':'','contents':null}; function doUpdate(ele){ console.log(ele.attr('data-choice')); if(ele.hasClass('file-isDir')){ currDir.loc = ele.attr('data-choice'); populateContents(); } //$() //$(this). } function updateContents(contents){ console.log(contents) // Change top header contents $('#files-location').html(currDir.loc) // if empty, return null, this shouldnt execute if the server is responding properly but ok if(contents===null) { $('#files-table').append(`