Last active
December 25, 2015 11:47
-
-
Save mikesprague/5706268 to your computer and use it in GitHub Desktop.
JavaScript: getRootWebSitePath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getRootWebSitePath() { | |
var _location = document.location.toString(); | |
var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3); | |
var applicationName = _location.substring(0, applicationNameIndex) + '/'; | |
var webFolderIndex = _location.indexOf('/', _ | |
location.indexOf(applicationName) + applicationName.length); | |
var webFolderFullPath = _location.substring(0, webFolderIndex); | |
return webFolderFullPath; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment