Skip to content

Instantly share code, notes, and snippets.

@vman
Created January 25, 2012 14:44
Show Gist options
  • Save vman/1676586 to your computer and use it in GitHub Desktop.
Save vman/1676586 to your computer and use it in GitHub Desktop.
urlcoffee
#Check whether the current web is the root web and if its not, append a "/" to the end.
currentUrl = _spPageContextInfo.webServerRelativeUrl
currentFormattedUrl = if currentUrl is "/" then currentUrl else currentUrl + "/"
alert currentFormattedUrl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment