Hey all!
New to javascript and still getting my head around strings...
Consider the following line of code...
var path = location.pathna me;
....after execution, the variable "path" contains something like
"file:///C:/Documents%20and %20Settings/user/Desktop/Test/fileread.htm"
How do I parse this down to "C:\Documen ts and Settings\user\D esktop\Test"
....or at least to "C:/Documents%20and %20Settings/user/Desktop/Test"
Is there a better function to retrieve the source folder containing the
current HTML document?
I need to know the path to the current folder to reference other files in
the same directory using a FileSystemObjec t.
Thanks!
New to javascript and still getting my head around strings...
Consider the following line of code...
var path = location.pathna me;
....after execution, the variable "path" contains something like
"file:///C:/Documents%20and %20Settings/user/Desktop/Test/fileread.htm"
How do I parse this down to "C:\Documen ts and Settings\user\D esktop\Test"
....or at least to "C:/Documents%20and %20Settings/user/Desktop/Test"
Is there a better function to retrieve the source folder containing the
current HTML document?
I need to know the path to the current folder to reference other files in
the same directory using a FileSystemObjec t.
Thanks!
Comment