Parse Drive Letter From URL
Hi Everyone,
I am trying to retrieve the drive letter from the address bar. The file is being loaded locally from a cd, however, I don't know which drive the user will be using. Any help would be appreciated. Thanks.
Example.
C:\Index.htm
Or
E:\ Index.htm
I want to retrieve the drive letter. Whatever it may be.
Re: Parse Drive Letter From URL
Code:
<script language="javascript">
function getDriveLetter()
{
var strToParse = document.location.href;
var pos=strToParse.indexOf("file:///");
if (pos>=0)
{
alert(strToParse.substr(pos+8,2));
}
}
</script>