Results 1 to 2 of 2

Thread: Parse Drive Letter From URL

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2001
    Posts
    759

    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.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width