Javascript server.mappath equivalent

I am using a location in my javascript: ‘…/…/myfolder/myfile.asp’

I want to make the script reusable by pages in different folders. The ‘myfolder’ is in the root of my site. How can I target this from any other folder such as the vbscript server.mappath(‘myfolder/myfile.asp’)?



In a file path or URL “./” means the current directory, “…/” means the current directory’s parent directory, and a relative path or URL starting with just a slash (“/”) refers to web root (or the root file system directory for non-URL paths). You can do something like “…/…/example.ext” and “…/…/…/example.ext”.

So try this:


:blush: now why didn’t i think of that?!