Created
October 21, 2019 14:58
-
-
Save mrshawnspencer/e7cf4f3793de057f006b939a05133a9d to your computer and use it in GitHub Desktop.
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
// Just get the hostname of the URL | |
// Example: https://electmyhealthplan.org/find-a-doctor | |
// Result: electmyhealthplan | |
// Test this in the browser console: | |
// var hostname = window.location.hostname.split('.')[0]; console.log(hostname); | |
var hostname = window.location.hostname.split('.')[0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment