js调用本地文件(IE)

<script> 
function openlocal(){ 
             var shell = new ActiveXObject("WSCRIPT.Shell");   
             shell.Run("c:\\book.txt",1);   
        } 
</script> 

  

html调用:

<a href="javascript:openlocal()">open local file</a>

  

不过仅限于IE浏览器和必须加载activeX插件,调用shell时候只能用绝对路径。

 

转载于 http://sunhuang.blogbus.com/logs/35469521.html

posted @ 2012-08-10 11:53  Daniel大东  阅读(1433)  评论(2编辑  收藏  举报