2015-02-11 91 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