【Javascript】この文書のパスは?
<html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta http-equiv="Content-Language" content="ja"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <title>Javascript-この文書のパスは?;</title> <script type="text/javascript"> <!-- function fncCurDir(){ var locarray = ((window.location.href).replace("file:///","")).split("/"); delete locarray[(locarray.length-1)]; var vFilePath = locarray.join("/"); divCurDir.innerText = vFilePath; } //--> </script> </head> <body> <input type="button" value="このファイルのパス" onclick="fncCurDir()" /> <div id="divCurDir" /> </body> </html>