複製程式碼 代碼如下: ?Js程式碼 <BR>////建立新目錄<BR> function newDir() { <BR> var txt = document.getElementById("newDir"); <BR> dirname) { <BR> alert("請填寫目錄名稱"); <BR> } else { <BR> $.ajax({ <BR> url: "/center/directorynew", <BR> data: { dirname: dirname }, <BR> > var DirectoryID = document.getElementBy var tOption = document.createElement("Option"); <BR> tOption.value = msg; <BR> txt.value = ""; <BR> 🎜><BR> } nse { <🎠 alert("增加失敗"); <BR> } <BR> } <BR> }); <BR> }//else <BR> ><BR><BR><BR>後台程式碼<BR><BR>傳回剛插入的目錄的id字串<BR> <BR> <BR><br><br>