I have this site that I need to find the root folder / plus the actual folder from which it works.
My problem is that during development, I have a folder on my local server, which, in turn, is in its own folder:
Then on the Internet I have a development site in a folder, so it can be tested before live execution, etc.
LOCAL SERVER: local / mytestSiteA / ...
TEST PASSPORT LIVE SERVER: www.asite.com/devbuild / ....
Now I can get the root with
document.location.hostname
But I need to then add the folder name after this so that I can upload content, etc. in development mode.
LOCAL SERVER
document.location.hostname + '/mytestSiteA/'
LIVE TEST SITE
document.location.hostname + '/devbuild/'
, , , dev, live dev live , , , , .., .
, , js script, .
:
/mytestSiteA//...
:
www.asite.com/devbuild/subsection/...
, .
Si