Skip to content

Instantly share code, notes, and snippets.

@mgechev
Last active December 21, 2015 08:38
Show Gist options
  • Select an option

  • Save mgechev/6279395 to your computer and use it in GitHub Desktop.

Select an option

Save mgechev/6279395 to your computer and use it in GitHub Desktop.
Host location
var getHostLocation = function() {
if (getHostLocation.hostLocation === undefined) {
var loc = window.location;
getHostLocation.hostLocation = loc.protocol + "//" + loc.hostname + ((loc.port !== undefined) ? ':' + loc.port : '');
}
return getHostLocation.hostLocation;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment