单独使用ckfinder选择图片

<script type="text/javascript" src="ckfinder/ckfinder.js"></script>

<script type="text/javascript">
function BrowseServer( inputId )
{
var finder = new CKFinder() ;
finder.BasePath = 'ckfinder/' ; //导入CKFinder的路径
finder.SelectFunction = SetFileField ;
finder.SelectFunctionData = inputId ;
finder.Popup() ;
}
function SetFileField( fileUrl, data )
{
document.getElementById( data["selectFunctionData"] ).value = fileUrl ;
}
</script>
...
<p>
<strong>Selected File URL</strong><br/>
<input id="xFilePath" name="FilePath" type="text" size="60" />
<input type="button" value="Browse Server" onclick="BrowseServer( 'xFilePath' );" />
</p>
<p>
<strong>Selected Image URL</strong><br/>
<input id="xImagePath" name="ImagePath" type="text" size="60" />
<input type="button" value="Browse Server" onclick="BrowseServer( 'xImagePath' );" />
</p>

posted @ 2011-03-01 20:20  王大湿  阅读(442)  评论(0编辑  收藏  举报