i am trying to get the current working directory path using JavaScript
when i execute from ubuntu: $root@ubuntu:/var/test/geek# firefox /var/www/application/test.html i get /var/www/application in my alert box instead of /var/test/geek in my alert box
used javascript code:
var path=window.location.pathname
alert(path);
above code gives path of test.html
editing: Is it possible using perl script? perl-cgi?
after knowing that it is not possible from javascript, tried it using perl script.
my $pwd=cwd();
and running the perl script from html :
when i execute from ubuntu: $root@ubuntu:/var/test/geek# firefox /var/www/application/test.html
i still get /var/www/application in page instead of /var/test/geek. is it possible from perl?
window.location.pathnamereturns the path of the page loaded. you cannot get the path on the user's machine (that is a security risk) - bansi