http://www.webreference.com/js/tips/001104.html

解决方案 »

  1.   

    <SCRIPT LANGUAGE="JavaScript">
    <!--
      myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
      file = myActiveXObject.GetFile("html文件的路径");
      alert("The file name is " + file.Name);
      alert("The file's short name is " + file.ShortName);
      alert("The path is " + file.Path);
      alert("The short path is " + file.ShortPath);
    // -->
    </SCRIPT>
      

  2.   

    谢谢,我意思是:不管包含javascript脚本html文件放在什么地方,我想在这个html文件中写javascript脚本得到所属文件夹的名称::但我这个html文件名称变化的:),我也不能得到这个html的名称.除了生成一个临时文件外有没有其他办法?