用js判断文件是否存在
( 更新:08-20 加入收藏)
<script type="text/javascript">
function filecheck(filePath) {
// filePath为文件的本地路径
var fileso = new ActiveXObject("Scripting.FileSystemObject");
if(fileso.FileExists(filePath)){
alert("文件存在!");
}else{
alert("文件不存在");
}
}
</script>
上一篇:js获取当前页面url信息