Skip to content

Instantly share code, notes, and snippets.

@alvarezmauro
Last active October 21, 2016 04:10
Show Gist options
  • Save alvarezmauro/9bbbff2b6e273e4af412 to your computer and use it in GitHub Desktop.
Save alvarezmauro/9bbbff2b6e273e4af412 to your computer and use it in GitHub Desktop.
JS - Get The Current Root URL
// Retrieve root URL
var rootUrl = location.protocol + '//' + location.host;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment