-
-
Save acanimal/bbde7ae88d9f2028cc5349049515a1f6 to your computer and use it in GitHub Desktop.
Get complete domain name with protocol and port if available. #js #urlFrom http://stackoverflow.com/questions/6941533/javascript-get-protocol-domain-and-port-from-url
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
const domain = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment