Skip to content

Instantly share code, notes, and snippets.

@githiro
Created June 10, 2013 05:43
Show Gist options
  • Select an option

  • Save githiro/5746763 to your computer and use it in GitHub Desktop.

Select an option

Save githiro/5746763 to your computer and use it in GitHub Desktop.
JS: Get domain name(include protocol, port)
var domain = (location.origin)? location.origin : (location.protocol + "//" + location.host);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment