|
-
Jul 11th, 2005, 02:41 PM
#1
Thread Starter
Fanatic Member
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.
-
Jul 12th, 2005, 01:45 AM
#2
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>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|