i have a treeview that shows my server directory structure. the user enters a folder name and i create that folder in my root directory at the server. my code is as follows
$.post("makeDir.php", {data:path}); //makeDir.php creates the folder using mkdir()
location.reload(true);
im using location.reload(true) to show user the updated tree. now the problem is that sumtimes, the ‘post’ request is not completed yet and it reloads the page soon enuf that the newly created folder is not displayed in the treeview. secondly im also not sure if using location.reload(true) is the proper way to do it!! in this situation shud i use $.ajax() function?
Use the
successparam of$.post