var fso ,f; //文件系统对象,文件对象 var ScriptName; fso = new ActiveXObject("Scripting.FileSystemObject"); ScriptName=window.location.href; ScriptName=ScriptName.replace(/%20/," "); function GetFilePath(FileNameWithPath) { var pos; pos=FileNameWithPath.lastIndexOf("/"); if(pos==-1) FileNameWithPath.lastIndexOf("\\"); return FileNameWithPath.substring(0,pos); }alert(GetFilePath(ScriptName.substring(8));
这个 <script language=jscript> var ScriptName; ScriptName=window.location.href; ScriptName=ScriptName.replace(/%20/," "); function GetFilePath(FileNameWithPath) { var pos; pos=FileNameWithPath.lastIndexOf("/"); if(pos==-1) FileNameWithPath.lastIndexOf("\\"); return FileNameWithPath.substring(0,pos); }alert(GetFilePath(ScriptName.substring(8))); </script>
var ScriptName;
fso = new ActiveXObject("Scripting.FileSystemObject");
ScriptName=window.location.href;
ScriptName=ScriptName.replace(/%20/," ");
function GetFilePath(FileNameWithPath)
{
var pos;
pos=FileNameWithPath.lastIndexOf("/");
if(pos==-1) FileNameWithPath.lastIndexOf("\\");
return FileNameWithPath.substring(0,pos);
}alert(GetFilePath(ScriptName.substring(8));
<script language=jscript>
var ScriptName;
ScriptName=window.location.href;
ScriptName=ScriptName.replace(/%20/," ");
function GetFilePath(FileNameWithPath)
{
var pos;
pos=FileNameWithPath.lastIndexOf("/");
if(pos==-1) FileNameWithPath.lastIndexOf("\\");
return FileNameWithPath.substring(0,pos);
}alert(GetFilePath(ScriptName.substring(8)));
</script>