2015-02-11 99 views
-3

我使用基於jQuery的文件,列出顯示文件目錄

代碼:

<script type="text/javascript"> 
$(document).ready(function() { 
$('#fileTreeDemo_2').fileTree({ 
root: '../../', 
script: 'connectors/jqueryFileTree.php', 
folderEvent: 'click', 
expandSpeed: 750, 
collapseSpeed: 750, 
multiFolder: false 
}, 
function(file){ 
alert(file); 
}); 
}); 
</script> 

<div id="fileTreeDemo_2"></div> 

結果: 它顯示文件列表,當我選擇文件時,它觸發function(file)並給出警報alert(file);

Alert

現在的問題,如果我想補充什麼場,其中所選擇的文件目錄,而不是讓我提醒alert(file);它表現出來的是input場內部,如圖此圖像中

Input

,所以我只是想修改function(file){ alert(file); });顯示的這個alertinput內容有id="dir"與代碼

<input type="text" name="something" id="dir"> 

〜感謝

+0

whats'.fileTree'? – 2015-02-11 21:14:41

回答

1
+0

謝謝,作品完美,對我非常有幫助 – 2015-02-11 21:28:05

相關問題