Re: Determine if path is absolute or relative
- From: "Evertjan." <exjxw.hannivoort@xxxxxxxxxxxx>
- Date: 17 Nov 2007 10:04:11 GMT
Giles wrote on 17 nov 2007 in microsoft.public.scripting.jscript:
Is there a simple JS function to determine if a path is absolute or
relative, that works for both local and web paths? picking up :// is
easy enough, but the path may be local, like d:\mydir\subdir\ (instead
of file:///d:/mydir/subdir/ ). Or it may be a share...
If you mean by "a path" "a string containing a path"
alert((/:/.test(myString))?'absolute':'relative')
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.
- Follow-Ups:
- Re: Determine if path is absolute or relative
- From: Anthony Jones
- Re: Determine if path is absolute or relative
- References:
- Determine if path is absolute or relative
- From: Giles
- Determine if path is absolute or relative
- Prev by Date: Determine if path is absolute or relative
- Next by Date: Re: Determine if path is absolute or relative
- Previous by thread: Determine if path is absolute or relative
- Next by thread: Re: Determine if path is absolute or relative
- Index(es):